# in code.pl, for example if ( /test1/ ) { print; } my $re = qr/test2/; my @array = split( /test3/, $ARGV[0] );