On Fri, Mar 07, 2003 at 01:03:33PM -0000, [EMAIL PROTECTED] wrote: > Hello London.pm > > first let me apologise, I know this mail will be accompanied by an HTML > version & I don't know how to prevent it. Outlook swears I'm using plain > text but somehow it doesn't end up that way. So, sorry... > > This is intended to re-sort STDIN according to a regexp: > > my $rxp = $ARGV[0]; > my %seen; > > print $rxp; > > while (<STDIN>) { > if (my ( $code ) = /$rxp/g) { if ( my ($code) =~ /$rxp/g ) ... surely? ie, s/=/=~/ > push @{ $seen{$code} } , $_; > } > } > > for (%seen) { > # could maybe sort these by the key > for (@$_) { I haven't seen the '@$_' syntax before. I'm sure the rest of the list will shout if it's not legal, tho. Do you mean something like: print for @_; ?
> print; > } > } > > It won't work with strict because I get "Can't use string ("AA") as an ARRAY > ref while "strict refs" in use." How do I use a proper array ref? Any other > comments very welcome... In my experience, this is usually due to a typo. ICBW, YMMV, IANAD. > > cheers, Sorry not to be more help. > Tom SW /joel