http://www.perlmonks.org?node_id=1003071


in reply to Re^8: How best to strip text from a file?
in thread How best to strip text from a file?

You're very welcome--and not a pain nor more problems! It was actually quite fun to work on and am glad it's working for you.

I think you're correct about the reason why the defined-or-equals (//=) throws an error on your *nix box. I believe that the operator was introduced in v5.10. You can recode each of the //= lines as follows:

This:

$hash{orderID} //= do { /Order ID:(\S+)/; $1 };

Can be written as:

$hash{orderID} = $1 if !defined $hash{orderID} and /Order ID:(\S+)/;

Again, let me know if you have any more questions about this script...