in reply to Re^2: Perl Help
in thread Perl Help

Escape them. See perlretut and perlre.

Replies are listed 'Best First'.
Re^4: Perl Help
by Slug (Acolyte) on Jan 22, 2008 at 12:05 UTC
    I still can't get it to pick up brackets. Please help? Is there an ASCII equivelent I can search for.
    open (READFILE, "<readme.txt") || die "Couldn't open file: $!"; $buffer = ""; while(<READFILE>) { #print $_; $commas++ while ($_ =~ m/,/g); $fullstops++ while ($_ =~ m/\./g); $openbracket++ while ($_ =~ m/\[/g); $closedbracket++ while ($_ =~ m/\]/g); $hyphens++ while ($_ =~ m/-/g); } print ("$commas commas\n"); print ("$fullstops full stops\n"); print ("$openbracket open brackets\n"); print ("$closedbracket closed brackets\n"); print ("$hyphens hyphens\n");