in reply to Not find a word / remove first char in string / remove last value in list
how do I remove the first char from a string in an array elementif ($line !~ /\b$word\b/) { ... }
I want to remove ", 1234567890" in array element 2. It wont always be a numbersubstr($string,0,1) = undef;
Now, the tricky bit is to split your records. You can either use a complicated split 306640, or you can use the Text::CSV_XS module from CPAN, or tilly's Text::xSV for a pure Perl implementation.my $str = '"hello, my name is Bob, my cell number is, 1234567890"'; $str =~ s/,[^,]*"$/"/; print "$str\n";
|
|---|