in reply to Splitting on escapable delimiter

I'm not as clever as some, so I did it the long way...
#!/usr/bin/perl use strict; use warnings; while( my $ln = <DATA> ) { chomp( $ln ); my @flds = split( '@', $ln ); foreach ( @flds ) { if ( /(#*)/ ) { print "/$ln/ --> /$1/\n" if ( length( $1 ) % 2 ) == 1; } } } __DATA__ #@##@###@####@#####@ #@## ###@#### #####@

This results in:

/#@##@###@####@#####@/ --> /#/ /#@##@###@####@#####@/ --> /###/ /#@##@###@####@#####@/ --> /#####/ /#@##/ --> /#/ /###@####/ --> /###/ /#####@/ --> /#####/
Revised: This won't work for a string with no pound signs. You'd need to modify the length test to include  || length( $1 ) == 0.