Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Pattern Matching-substitution replacement not terminated.

Expand Messages
  • John Schubert
    Thanks Paul I had just came to the same conclusion because line 8 didn t match the substitution pattern s/// You re much quicker than I. John Schubert ...
    Message 1 of 4 , Dec 29, 2005
    • 0 Attachment
      Thanks Paul

      I had just came to the same conclusion because line 8 didn't match
      the substitution pattern s///

      You're much quicker than I.

      John Schubert

      On Dec 29, 2005, at 12:40 PM, Paul Archer wrote:

      > Believe it or not, your problem is on line 8, not line 11. The
      > substitute
      > you do there is using a \s as a terminator. It starts on line 8,
      > but we
      > don't see another \s until line 11. Line 8 should read:
      > if (s/\s*(kgs?|kilograms?).*//) {
      > not:
      > if (s\s*(kgs?|kilograms?).*//) {
      >
      > Paul
      >
      >
      > 8:23pm, montanaproducts wrote:
      >
      > > Here is the code!
      > >
      > > #!/usr/bin/perl -w
      > >
      > > print "your weight:";
      > > $_=<STDIN>;
      > > chomp;
      > > s/^\s+//; # Remove leading spaces,
      > if any.
      > > if (m/(lbs?|kgs?|kilograms?|pounds?)/i) {
      > > if (s\s*(kgs?|kilograms?).*//) {
      > > $_*=2.2;
      > > } else {
      > > s/\s*(lbs?|pounds?).*//; #substitute-begin w/
      > whitespace-lbs or pounds end
      > > with anything.
      > > }
      > > }
      > > print "You're ass is on the line";
      > >
      > > Here is the error message:
      > >
      > > Substitution replacement not terminated at perl24_p107 line 11.
      > >
      > > This is from the book "Teach Yourself Perl in 24 Hours p107.
      > >
      > > I'm using OSX 10.4 at the terminal and a bash shell. I can't see
      > anything wrong with this.
      > > If I remove the -w from the first line I still get the same error
      > message.
      > >
      > > Thanks in Advance
      > >
      > > John Schubert
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/
      > groups-32.html
      > > Yahoo! Groups Links
      > >
      > >
      > >
      > >
      > >
      > >
      >
      >
      >
      > ---------------------------
      > 404 Error - Item Not Found
      > <haiku>
      > You step in the stream,
      > but the water has moved on.
      > That page is not here.
      > </haiku>
      > ---------------------------
      >
      >
      > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/
      > groups-32.html
      >
      >
      >
      > SPONSORED LINKS
      > Basic programming language C programming language Computer
      > programming languages
      > The c programming language C programming language List of
      > programming languages
      >
      > YAHOO! GROUPS LINKS
      >
      > Visit your group "perl-beginner" on the web.
      >
      > To unsubscribe from this group, send an email to:
      > perl-beginner-unsubscribe@yahoogroups.com
      >
      > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
      >
      >



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.