in reply to extract the value before a particualr string

If you don't like split, try regexes instead. Something like ...
if (/(\d+)\/total$/) { print "$1\n"; }
If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)

Replies are listed 'Best First'.
Re^2: extract the value before a particualr string
by nanban (Initiate) on Sep 05, 2013 at 10:23 UTC
    Thanks for the reply... Can we implement it using split? i am pretty new to perl...
Re^2: extract the value before a particualr string
by nanban (Initiate) on Sep 05, 2013 at 10:29 UTC
    will it be possible to use split???
      nanban,
      will it be possible to use split???

      The first argument to split is a regular expression so it is really the difference between using capturing parens in a regular expression or using a regular expression to break the string into pieces but they are both regular expression solutions.

      Cheers - L~R