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

Re: [PBML] Files list

Expand Messages
  • tnas
    What the @$_ variable do? What it mean?
    Message 1 of 10 , Jul 4, 2006
      What the @$_ variable do? What it mean?

      Jabir Ahmed escreveu:
      >
      > try using
      >
      > this would store the contents of the dir in @files as an array
      >
      > jab
      >
      > sachin gupta <gupta_sachin17@...
      > <mailto:gupta_sachin17%40yahoo.com>> wrote: You can use
      > use File::Listing qw(parse_dir);
      > for (parse_dir(`ls -l`)) {
      > ($name, $type, $size, $mtime, $mode) = @$_;
      > next if $type ne 'f'; # plain file
      > #...
      > }
      >
      > for more info refer search.cpan.org
      >
      > --- tnas <nascimentothiago@...
      > <mailto:nascimentothiago%40yahoo.com.br>> wrote:
      >
      > > Hi,
      > >
      > > Do someone know tell me if exists a .pm with one
      > > function that list the
      > > files of the a directory?
      > >
      > > Thanks and regards
      > >
      > >
      > >
      > >
      > >
      >
      > __________________________________________________
      > Do You Yahoo!?
      > Tired of spam? Yahoo! Mail has the best spam protection around
      > http://mail.yahoo.com <http://mail.yahoo.com>
      >
      >
      >
      >
      > Phone (mobile) : +91-98861 36420
      > E-Mail: jabirahmed@... <mailto:jabirahmed%40yahoo.com>,
      > jabirahmed@... <mailto:jabirahmed%40gmail.com>
      > --
      > "To be sure of hitting the target, shoot first, and call whatever you
      > hit the target.
      > ---
      >
      > ---------------------------------
      > Do you Yahoo!?
      > Get on board. You're invited to try the new Yahoo! Mail Beta.
      >
      > [Non-text portions of this message have been removed]
      >
      >
    • Mr. Shawn H. Corey
      ... If the variable $_ contains a reference to an array, this will dereference it. It is the same as writing @{ $_ } #!/usr/bin/perl use strict; use warnings;
      Message 2 of 10 , Jul 4, 2006
        tnas wrote:
        > What the @$_ variable do? What it mean?
        >

        If the variable $_ contains a reference to an array, this will
        dereference it. It is the same as writing @{ $_ }

        #!/usr/bin/perl

        use strict;
        use warnings;

        my @array = qw( a b c );
        $_ = \@array;

        for my $item ( @$_ ){
        print "$item\n";
        }

        __END__

        Similarly, if $_ contains a reference to a hash, %$_ will dereference
        the hash.

        --
        __END__

        Just my 0.00000002 million dollars worth,
        --- Shawn

        "For the things we have to learn before we can do them, we learn by
        doing them."
        Aristotle

        * Perl tutorials at http://perlmonks.org/?node=Tutorials
        * A searchable perldoc is at http://perldoc.perl.org/
      • tnas
        thanks
        Message 3 of 10 , Jul 4, 2006
          thanks

          Mr. Shawn H. Corey escreveu:
          >
          > tnas wrote:
          > > What the @$_ variable do? What it mean?
          > >
          >
          > If the variable $_ contains a reference to an array, this will
          > dereference it. It is the same as writing @{ $_ }
          >
          > #!/usr/bin/perl
          >
          > use strict;
          > use warnings;
          >
          > my @array = qw( a b c );
          > $_ = \@array;
          >
          > for my $item ( @$_ ){
          > print "$item\n";
          > }
          >
          > __END__
          >
          > Similarly, if $_ contains a reference to a hash, %$_ will dereference
          > the hash.
          >
          > --
          > __END__
          >
          > Just my 0.00000002 million dollars worth,
          > --- Shawn
          >
          > "For the things we have to learn before we can do them, we learn by
          > doing them."
          > Aristotle
          >
          > * Perl tutorials at http://perlmonks.org/?node=Tutorials
          > <http://perlmonks.org/?node=Tutorials>
          > * A searchable perldoc is at http://perldoc.perl.org/
          > <http://perldoc.perl.org/>
          >
          >
        • Prasanna Goupal
          Hi, I am creating graphs using following programs, but i am getting following error, do you have any idea about it? Error : Can t locate object method png
          Message 4 of 10 , Jul 5, 2006
            Hi,

            I am creating graphs using following programs, but i am getting following error, do you have any idea about it?

            Error :

            Can't locate object method "png" via package "GD::Image" at /proj/Httpd/cgi-bin/show_image.pl line 76.

            Code :

            my $mygraph = '';
            if($type){
            $mygraph = GD::Graph::lines->new(300, 200);
            } else {
            $mygraph = GD::Graph::lines->new(500, 350);
            }
            $mygraph->set(
            x_label => 'Year',
            y_label => 'Trend',
            title => $lable,
            line_types => [1,1,1],
            line_width => 2,
            dclrs => ['green','red','blue'],
            ) or warn $mygraph->error;
            $mygraph->set_legend_font(GD::gdMediumBoldFont);
            $mygraph->set_legend($cus_param1,$cus_param2);
            my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
            print $myimage->png;



            ---------------------------------
            Do you Yahoo!?
            Everyone is raving about the all-new Yahoo! Mail Beta.

            [Non-text portions of this message have been removed]
          • Mr. Shawn H. Corey
            ... Older versions of GD::Image do not create PNGs. Check the version with: perl -MGD -e print $GD::VERSION, n It must be 1.20 or greater. Can you save it
            Message 5 of 10 , Jul 5, 2006
              Prasanna Goupal wrote:
              > Hi,
              >
              > I am creating graphs using following programs, but i am getting following error, do you have any idea about it?
              >
              > Error :
              >
              > Can't locate object method "png" via package "GD::Image" at /proj/Httpd/cgi-bin/show_image.pl line 76.
              >

              Older versions of GD::Image do not create PNGs. Check the version with:
              perl -MGD -e 'print $GD::VERSION, "\n"' It must be 1.20 or greater.

              Can you save it as a GIF file?


              --
              __END__

              Just my 0.00000002 million dollars worth,
              --- Shawn

              "For the things we have to learn before we can do them, we learn by
              doing them."
              Aristotle

              * Perl tutorials at http://perlmonks.org/?node=Tutorials
              * A searchable perldoc is at http://perldoc.perl.org/
            • Prasanna Goupal
              Hi, Thanks for your support.. I got the cause.. When we install GD module on the server, it asks for different suporrted formats, and i found that png support
              Message 6 of 10 , Jul 5, 2006
                Hi,

                Thanks for your support.. I got the cause.. When we install GD module on the server, it asks for different suporrted formats, and i found that png support was banned.

                Once again Thanks.

                Regards,
                Prasanna A. Goupal

                "Mr. Shawn H. Corey" <shawnhcorey@...> wrote:
                Prasanna Goupal wrote:
                > Hi,
                >
                > I am creating graphs using following programs, but i am getting following error, do you have any idea about it?
                >
                > Error :
                >
                > Can't locate object method "png" via package "GD::Image" at /proj/Httpd/cgi-bin/show_image.pl line 76.
                >

                Older versions of GD::Image do not create PNGs. Check the version with:
                perl -MGD -e 'print $GD::VERSION, "\n"' It must be 1.20 or greater.

                Can you save it as a GIF file?

                --
                __END__

                Just my 0.00000002 million dollars worth,
                --- Shawn

                "For the things we have to learn before we can do them, we learn by
                doing them."
                Aristotle

                * Perl tutorials at http://perlmonks.org/?node=Tutorials
                * A searchable perldoc is at http://perldoc.perl.org/





                ---------------------------------
                Do you Yahoo!?
                Next-gen email? Have it all with the all-new Yahoo! Mail Beta.

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