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

Re: [PBML] return file handger

Expand Messages
  • jiqiang yao
    Thank you, Rob. I have written a subroutine which can extract all the files within this folder and this is exactly what I need. ...
    Message 1 of 11 , May 14 3:26 PM
    • 0 Attachment
      Thank you, Rob.
      I have written a subroutine which can extract all the
      files within this folder and this is exactly what I
      need.

      --- Rob Biedenharn <Rob@...> wrote:

      > That's an odd way to phrase a request for Randall's
      > consulting
      > rates? Perhaps you could try
      > perldoc -f opendir
      > before you decide whether you really want to hire a
      > consultant.
      >
      > -Rob
      >
      > On May 14, 2007, at 12:28 PM, jiqiang yao wrote:
      >
      > > Thank you very much.
      > >
      > > Can you write a similar one to open a directory?
      > >
      > > --- merlyn@... wrote:
      > >
      > >>>>>>> "jiqiang" == jiqiang yao
      > >> <jiqiang123@...> writes:
      > >>
      > >> jiqiang> I want to write a subroutine for
      > openfile
      > >> (see below).
      > >> jiqiang> However, the subroutine failed to be
      > >> returned to
      > >> jiqiang> $fhandle. Can anybody tells me why?
      > >>
      > >> Yes, stop using package-based filehandles. Use
      > >> lexical filehandles.
      > >>
      > >> sub openfile {
      > >> open my $handle, "<", shift or die "Cannot
      > open:
      > >> $!";
      > >> return $handle;
      > >> }
      > >>
      > >> But if it's this short, I wouldn't even write a
      > >> subroutine.
      > >>
      > >> --
      > >> Randal L. Schwartz - Stonehenge Consulting
      > Services,
      > >> Inc. - +1 503 777 0095
      > >> <merlyn@...>
      > >> <URL:http://www.stonehenge.com/merlyn/>
      > >> Perl/Unix/security consulting, Technical writing,
      > >> Comedy, etc. etc.
      > >> See PerlTraining.Stonehenge.com for onsite and
      > >> open-enrollment Perl training!
      > >>
      >
      > Rob Biedenharn http://agileconsultingllc.com
      > Rob@...
      >
      >
      >




      ____________________________________________________________________________________
      It's here! Your new message!
      Get new email alerts with the free Yahoo! Toolbar.
      http://tools.search.yahoo.com/toolbar/features/mail/
    • Damien Carbery
      ... use LWP::Simple; my $status = getstore( http://www.yahoo.com , yahoo-home.html ); print File downloaded. if is_success($status);
      Message 2 of 11 , May 15 7:40 AM
      • 0 Attachment
        --- In perl-beginner@yahoogroups.com, jiqiang yao <jiqiang123@...> wrote:
        >
        > Hi,
        > How to save the contents as html file given an
        > internet address?
        >

        use LWP::Simple;
        my $status = getstore( 'http://www.yahoo.com', 'yahoo-home.html' );
        print "File downloaded." if is_success($status);
      Your message has been successfully submitted and would be delivered to recipients shortly.