Ned Konz wrote:
> # this is four times as fast as s/// solution
> sub toutf
> {
>       my $s = shift;
>       pack('v*', unpack('c*', $s));
> }

Cool :-) Wouldn't have thought of that.

> while (<>)
> {
>       my $line = $_;
>       map { $line =~ s/$_/$subs{$_}/g } keys(%subs);

Some people consider it bad style to use map in void context -- building up
a return list and then throwing it away. You might consider, for example:

      $line =~ s/$_/$subs{$_}/g foreach keys %subs;

as an alternative.

>       print $line;
> }

Cheers,
Philip

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to