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

Re: [NTS] ^!RunPerl question

Expand Messages
  • Alan C.
    Hello, Just to share a NTB/Perl (mostly perl) tidbit that I discoverd ... I discovered a shorter/less perl code that still accomplishes the exact same task.
    Message 1 of 3 , Dec 2, 2002
    • 0 Attachment
      Hello,

      Just to share a NTB/Perl (mostly perl) tidbit that I discoverd

      >H="_pl_trmleadspace"
      >#!/perl/bin/perl -w
      >while ($line = <>) {
      > for ($line =~ s/^ +//) {
      > print $line;
      > }
      >}

      I discovered a shorter/less perl code that still accomplishes the exact same task. The below clip is a replacement for the above clip. It's more/closer like the perl script in samplecode library--it uses perl's default variable: $_

      H="_pl_trmleadspace"
      #!/perl/bin/perl -w
      while (<>) {
      s/^ +//;
      print "$_";
      }
      # end

      --
      Alan.
    Your message has been successfully submitted and would be delivered to recipients shortly.