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

Re: [PBML] simple question

Expand Messages
  • Carl Flippin
    The problem is most likely that you have something quoted wrong. Could you post the code that is failing? That would make it easier to diagnose.
    Message 1 of 5 , Feb 4 8:55 AM
    • 0 Attachment
      The problem is most likely that you have something quoted wrong. Could
      you post the code that is failing? That would make it easier to diagnose.


      On Tue, Feb 04, 2003 at 04:40:36PM -0000, grappling_machine <faison09@...> wrote:
      > # My question is how can I print out the $string variable but enter
      > new lines inbetween each $string instance?
      > # When I use the \n character right after my $string variable my
      > script comes up with errors. Thanks in advance .
      >
      >
      > my $number;
      > my $string;
      >
      >
      > print "please enter a string.\n";
      >
      > $string = <>;
      > chomp ($string);
      > print "\n";
      >
      > print "enter a number and i will multiply your string by this
      > number.\n";
      > $number = <>;
      > chomp ($number);
      >
      >
      > my $value = $number;
      >
      > print $string x $number;
      >
      >
      >
      >
      >
      > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
    • Damien Carbery <daymobrew@yahoo.com>
      If you remove the chomp ($string); line then the code will work as desired. What is the purpose of the my $value = $number; line?
      Message 2 of 5 , Feb 4 11:50 AM
      • 0 Attachment
        If you remove the
        chomp ($string);
        line then the code will work as desired.

        What is the purpose of the
        my $value = $number;
        line?

        --- In perl-beginner@yahoogroups.com, "grappling_machine
        <faison09@h...>" <faison09@h...> wrote:
        > # My question is how can I print out the $string variable but enter
        > new lines inbetween each $string instance?
        > # When I use the \n character right after my $string variable my
        > script comes up with errors. Thanks in advance .
        >
        >
        > my $number;
        > my $string;
        >
        >
        > print "please enter a string.\n";
        >
        > $string = <>;
        > chomp ($string);
        > print "\n";
        >
        > print "enter a number and i will multiply your string by this
        > number.\n";
        > $number = <>;
        > chomp ($number);
        >
        >
        > my $value = $number;
        >
        > print $string x $number;
      Your message has been successfully submitted and would be delivered to recipients shortly.