Help for this page

Select Code to Download


  1. or download this
    my $string = "Keep this | toss this";
    my ( $keep ) = $string =~ /^(.*?)\|/;
    print $keep, "\n";
    
  2. or download this
    my $string = "keep this | keep that too | toss this | toss this too";
    my ( $this, $that );
    ( $this, $that, undef ) = split /\|/, $string, 3;