Hi Chromatic, Yessir. You are right. I tried the following and that output didnt take time. so this:
#!/usr/bin/perl use warnings; use strict; #My First Reference called ref1.pl!! my $array = [qw(this is a test to check anonymous arrays)]; print "@{$array}\n"; print "$array->[3]\n"
gave the following output in no time.
C:\perl\practice>perl ref2.pl this is a test to check anonymous arrays test

Well, if the disk i/os are causing that then that could be a problem for me..... I wanted to create a refence to an anonymous array so that it can hold command line outputs and I can play around with it.....I tried it with  ping localhost command and that took even longer...say about 6 seconds..... May be I shouldnt use reference to anonymous arrays for storing command line outputs..cause that wont be a good way to deal with it.

Note - I wanted to make an anonymous array with words in it...I tried  qw [this is a test to check anonymous arrays]but Perl told me something like "Useless use of a constant..."...so I tried some other ways and finally tried  [qw(this is a test to check anonymous arrays)] and that seems to work.

Is that the right way of creating a reference to an anonymous array with words in it?

In reply to Re^2: why is my reference taking a while to execute? by perl514
in thread why is my reference taking a while to execute? by perl514

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.