Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Unexpected deletion of data using > operator

by n3toy (Hermit)
on Dec 07, 2008 at 18:26 UTC ( [id://728758]=note: print w/replies, xml ) Need Help??


in reply to Unexpected deletion of data using > operator

Not initializing a variable is something that has bitten me before! And, of course I assume right away it is my code or logic and not something simple. (Usually, it ends up being a combination of both!)

Would this snippet meet your needs?:
foreach my $line (@customerarray) { my ($memono, $cusref, $datestamp) = split '::', $line; if ( ($timestamp - $datestamp) > 1296000 ) { next; } else { $line = $line . $line . "\n"; } } print FH "$item";
I hope this is somewhat helpful.

Jamie

Replies are listed 'Best First'.
Re^2: Unexpected deletion of data using > operator
by jonnyfolk (Vicar) on Dec 07, 2008 at 19:49 UTC

    Thanks for your input, but surely bringing $item out of a hat at the end is what you were criticising me for in the first place?? :)

    davidrw's reply above (the most compressed version) removes the problem (typo not withstanding), simply by copying and pasting over my previous code. Therefore there must be a problem in that code, but I have not yet found it. Cheers.

      Whoops... Add: use MagicHat; to the top of the snippet. :-)

      This will teach me to test code before posting.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-19 17:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found