in reply to Re: perl pattern match for end of string using STDIN and chomp
in thread perl pattern match for end of string using STDIN and chomp

perl 5.8.0 run on Linux 2.4.21-40.ELsmp DOES NOT WORK, you are correct I ran on perl 5.8.7 on my windows machine and it worked fine, going to try and find a more current version on our Linux machine and try and find if it is a perl version problem or if it is directly related to linux
  • Comment on Re^2: perl pattern match for end of string using STDIN and chomp

Replies are listed 'Best First'.
Re^3: perl pattern match for end of string using STDIN and chomp
by ikegami (Patriarch) on Oct 08, 2009 at 19:09 UTC

    Works for me in 5.8.0

    get some string: /xxxx/yyyy/ZZZ_xxxx.CCC ZZZ CCC /xxxx/yyyy/ZZZ_xxxx

    And there's no reason it shouldn't. $ not matching the end of the string would have been caught by tests. Your build is very broken if the last pattern doesn't match given the specified input.

Re^3: perl pattern match for end of string using STDIN and chomp
by kennethk (Abbot) on Oct 08, 2009 at 19:17 UTC
    Ditto on ikegami above, tested v5.8.8 built for x86_64-linux-gnu-thread-multi on Ubuntu 8.04 LTS as well as Windows. What happens when you run this?

    #!/usr/bin/perl print "get some string: "; $dropped = chop($string = <STDIN>); print ord $dropped, " ", ord $/, "\n"; #$string = $ARGV[0]; #chomp($string); $string =~ m/\/([[:alnum:]]+)_.*\.(.+)$/; print "$1\n"; $type = $2; print "$type\n"; $string =~ m/(.+)\.${type}$/; #$string =~ m/(.+)\.${type}\Z/; #$string =~ m/(.+)\.${type}\z/; #$string =~ m/(.+)\.${type}/; print "$1\n"; exit 0;
      When i run your code i get this:
      get some string: /xxxx/xxxxx/YYY_xxxxx.CCC 10 10 YYY CCC YYY