this sounds like a perfect use for a hash
%month = (
1 => "Jan",
2 => "Feb",
);
print $month{"1"}, "\n";
On 10/10/06, Goke Aruna <[EMAIL PROTECTED]> wrote:
i want to process the attached file and i want to replace the $data[1] with
equivalent month is strings.
i have this code but
sorry, now I am spamming :)
perl -e '$tring="spam"."ringtones"."text"; if ( $tring =~ m/qwerty/
){print "spam\n"}'
perl -e '$tring="spam"."ringtones"."text"; if ( $tring =~
m/spam|ringtones|etc/ ){print "sp
there is also grep
perl -e '@rray = ("this", "is", "a", "test", "spam"); print (grep
/bad|yuk|ugly|spam/, @rray)'
On 10/10/06, Charles Farinella <[EMAIL PROTECTED]> wrote:
Tom Phoenix wrote:
> It's hard to say for sure why it's not working, without seeing what
> you're trying to do. But
I am sure someone else can do it better, but how about the following?
foreach (@rray){
if (/match/) {print "yay";}
}
On 10/10/06, Charles Farinella <[EMAIL PROTECTED]> wrote:
How can I iterate through an array and if I find a match do something
without doing that thing for every element in th
Hi, I am new to the list, so I apologise if I do anything wrong :)
I made the script below to check files that are duplicates but I only
want to check the first few bytes (perhaps 1-10k, depending on false
positives)
I would like to convert it to native perl, can someone give me some pointers?