Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: problem with Crypt::CBC

by blindluke (Hermit)
on Nov 10, 2014 at 12:55 UTC ( [id://1106693]=note: print w/replies, xml ) Need Help??


in reply to problem with Crypt::CBC

My quick guess would be: try splitting by "\n". Perl should be smart enough to figure out that it's actually two characters. So, try this:

@lines = split(/\n/,$decrypted);

And in case you are wondering why this should work, here is an explanation of the details.

UPDATE:

Another suggestion - there is no need to run split twice, this is enough:

@lines = split(/\n/,$decrypted); $num_lines = @lines;

Now, when you modify the split regexp, you only have to do it in one place.

Good luck with your project, and welcome to the Monastery.

- Luke

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1106693]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-24 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found