[30489] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1732 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 19 00:09:49 2008

Date: Fri, 18 Jul 2008 21:09:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 18 Jul 2008     Volume: 11 Number: 1732

Today's topics:
    Re: C linked lists in Perl <szrRE@szromanMO.comVE>
    Re: C linked lists in Perl <jdhog@gmail.com>
    Re: C linked lists in Perl <szrRE@szromanMO.comVE>
    Re: C linked lists in Perl <uri@stemsystems.com>
    Re: C linked lists in Perl <szrRE@szromanMO.comVE>
        Editing HTML Page <imanuk2007@googlemail.com>
    Re: Editing HTML Page <glex_no-spam@qwest-spam-no.invalid>
    Re: Editing HTML Page <bill@ts1000.us>
    Re: Editing HTML Page <tadmc@seesig.invalid>
    Re: how to create a hash whose key is a reference <ben@morrow.me.uk>
    Re: How to identify a 32 or 64 bit OS? <szrRE@szromanMO.comVE>
    Re: reliability problem with Finance::QuoteHist::Yahoo <szrRE@szromanMO.comVE>
    Re: reliability problem with Finance::QuoteHist::Yahoo <r.ted.byers@gmail.com>
    Re: reliability problem with Finance::QuoteHist::Yahoo <glex_no-spam@qwest-spam-no.invalid>
    Re: SOS...on system command <whynot@pozharski.name>
    Re: understading double scalar variable $$ <uri@stemsystems.com>
    Re: understading double scalar variable $$ <slick.users@gmail.com>
    Re: understading double scalar variable $$ <jurgenex@hotmail.com>
    Re: understading double scalar variable $$ <tadmc@seesig.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 18 Jul 2008 13:58:07 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: C linked lists in Perl
Message-Id: <g5r04v02hop@news4.newsguy.com>

Uri Guttman wrote:
>>>>>> "TZ" == Ted Zlatanov <tzz@lifelogs.com> writes:
>
>> On Wed, 16 Jul 2008 20:43:27 GMT Uri Guttman <uri@stemsystems.com>
>> wrote: as i said above no lang HAS linked lists
>>
>> Java has them as part of the standard java.util libraries that come
>> with the standard JRE.
>
> i wouldn't call that part of the lang. but some would.

I would call it a library or an extension (not like a Perl Module that 
comes bundled with Perl), which, IIRC, uses a process not unlike C to 
create linked lists from primitives; it just gives you a pre-made 
interface.

-- 
szr 




------------------------------

Date: Fri, 18 Jul 2008 14:07:41 -0700
From: "Gordon Corbin Etly" <jdhog@gmail.com>
Subject: Re: C linked lists in Perl
Message-Id: <6ecf0vF67q4sU1@mid.individual.net>

Uri Guttman wrote:
>>>>>> "TZ" == Ted Zlatanov <tzz@lifelogs.com> writes:

 ...

> > At this point you're arguing that with Lisp you have an
> > assembled band saw (vs. Perl's Swiss Army knife or Java's
> > diesel-powered hammer-screwdriver) but you can't use it until you
> > plug it in.  Well, yeah, but that is not an argument worth having.

> yeah, like arguing with brick walls over PERL vs Perl. :)

My thoughts exactly. But you don't see me going around random threads 
attempting to incite a flame war, when the very problem you complain 
about stems from your own inability to be reaonable when it comes to 
things you have a hard view on.


--
Gordon C. Etly
Email: perl -e "print q{}.reverse(q{moc.liamg@ylte.nodrog})" 




------------------------------

Date: Fri, 18 Jul 2008 14:10:44 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: C linked lists in Perl
Message-Id: <g5r0sl02icn@news4.newsguy.com>

Ted Zlatanov wrote:
> On Thu, 17 Jul 2008 17:26:58 GMT Uri Guttman <uri@stemsystems.com>
> wrote:
[...]
> I really don't know how much more "built-in" linked lists can be than
> what you find in Lisp, considering that code and data both are lists
> and treated as such by the language, and you can construct either
> dynamically.  At this point you're arguing that with Lisp you have an
> assembled band saw (vs. Perl's Swiss Army knife or Java's
> diesel-powered hammer-screwdriver) but you can't use it until you
> plug it in.  Well, yeah, but that is not an argument worth having.

You forgot PHP's nuclear-powered 10,000 piece rachet set.  :-)

-- 
szr 




------------------------------

Date: Fri, 18 Jul 2008 21:14:20 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: C linked lists in Perl
Message-Id: <x77ibi7v4j.fsf@mail.sysarch.com>

>>>>> "GCE" == Gordon Corbin Etly <jdhog@gmail.com> writes:

  GCE> Uri Guttman wrote:
  >>>>>>> "TZ" == Ted Zlatanov <tzz@lifelogs.com> writes:

  GCE> ...

  >> > At this point you're arguing that with Lisp you have an
  >> > assembled band saw (vs. Perl's Swiss Army knife or Java's
  >> > diesel-powered hammer-screwdriver) but you can't use it until you
  >> > plug it in.  Well, yeah, but that is not an argument worth having.

  >> yeah, like arguing with brick walls over PERL vs Perl. :)

  GCE> My thoughts exactly. But you don't see me going around random threads 
  GCE> attempting to incite a flame war, when the very problem you complain 
  GCE> about stems from your own inability to be reaonable when it comes to 
  GCE> things you have a hard view on.

brickhead ignored. especially since you never talk perl.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


------------------------------

Date: Fri, 18 Jul 2008 15:05:13 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: C linked lists in Perl
Message-Id: <g5r42p02lsf@news4.newsguy.com>

Joost Diepenmaat wrote:
> cartercc <cartercc@gmail.com> writes:
>
>> I guess like almost everybody, I like to discuss (argue) the merits
>> of different technologies. In my world, the big two are Java and
>> ColdFusion. Recently, we had someone with a background in embedded
>> systems who has been advocating C. The conversation goes something
>> like this:
>>
>> him - Does Perl have linked lists?
>> me - No.
>
> Perl does have linked lists at least as much as C does.
>
> my $ll = [ 'bla', [ 'blie', [ 'bloe' ]]];
>
> etc.
>
> But expect perl's garbage collector to get in your face if you create
> giant linked lists. Not that you'd want to do that, anyway.

Why would the GC get in the way? In a nutshell, it doesn't free 
something until no one is referring to it anymore (the ref-count is 
zero), so I'd imagine there would be no problem, or have you run into 
issue in certain circumstances?

-- 
szr 




------------------------------

Date: Fri, 18 Jul 2008 11:20:23 -0700 (PDT)
From: invincible <imanuk2007@googlemail.com>
Subject: Editing HTML Page
Message-Id: <5cba08ec-99ec-415e-9d47-50c268bbe067@y21g2000hsf.googlegroups.com>

All,

I have a problem which I thought of discussing with you lot so as to
get your views on the solution.

In my intranet there is an section where we have our customer details.
This is fairly straight as all the details are saved in customer.log
file on the unix directory.

There is one index.cgi file which has certain columns which allow us
to add customer and search by several fields including customer name,
location etc.

Now the PROBLEM:  We do not have any cgi script to edit these details.
As told before the details are stored in
customer.log file and I suppose I would have to create a link in
index.cgi to edit all the details displayed .

Would somebody be able to let me know how to change these details ,
creating a new link in index.cgi.

Sample fields in the index.cgi is as below.


<tr><td>Almstrong</td><td>Cust Name</td><td>Shit Bing</td><td>Liabel
Support Team</td><td>Number:</td></tr>
<tr><td>Almstrong</td><td>Cust Name</td><td>Dove Solo</td><td>Liabel
Support Team</td><td>Number:</td></tr>

Any help would be greatly appreciated.

Ciao.


------------------------------

Date: Fri, 18 Jul 2008 14:26:38 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Editing HTML Page
Message-Id: <4880ee6e$0$89869$815e3792@news.qwest.net>

invincible wrote:
[...]
> Now the PROBLEM:  We do not have any cgi script to edit these details.
> As told before the details are stored in

Many people don't know or remember the details you may have posted.

> customer.log file and I suppose I would have to create a link in
> index.cgi to edit all the details displayed .
> 
> Would somebody be able to let me know how to change these details ,
> creating a new link in index.cgi.
[...]
Parse the file. in your CGI.
Display the data in an HTML form.
When it's submitted, the CGI will parse the input and rewrite the file.
( Note the permissions on the file need to be writable by the owner
of the process running the Web server. )

Start by learning about CGI and the different elements HTML provides
in a form.  When you're ready to program it, there are many
options that will help, usually CGI can tackle it:

perldoc CGI


------------------------------

Date: Fri, 18 Jul 2008 15:55:17 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Re: Editing HTML Page
Message-Id: <6c500497-0542-4ca7-869d-aa30911b2ffb@z66g2000hsc.googlegroups.com>

On Jul 18, 2:20=A0pm, invincible <imanuk2...@googlemail.com> wrote:
> All,
>
> I have a problem which I thought of discussing with you lot so as to
> get your views on the solution.
>
> In my intranet there is an section where we have our customer details.
> This is fairly straight as all the details are saved in customer.log
> file on the unix directory.
>
> There is one index.cgi file which has certain columns which allow us
> to add customer and search by several fields including customer name,
> location etc.
>
> Now the PROBLEM: =A0We do not have any cgi script to edit these details.
> As told before the details are stored in
> customer.log file and I suppose I would have to create a link in
> index.cgi to edit all the details displayed .
>
> Would somebody be able to let me know how to change these details ,
> creating a new link in index.cgi.
>
> Sample fields in the index.cgi is as below.
>
> <tr><td>Almstrong</td><td>Cust Name</td><td>Shit Bing</td><td>Liabel
> Support Team</td><td>Number:</td></tr>
> <tr><td>Almstrong</td><td>Cust Name</td><td>Dove Solo</td><td>Liabel
> Support Team</td><td>Number:</td></tr>
>
> Any help would be greatly appreciated.
>
> Ciao.

Did you type this in or do you really have a field called "<td>Shit
Bing</td>"?

Bill H


------------------------------

Date: Fri, 18 Jul 2008 19:46:26 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Editing HTML Page
Message-Id: <slrng82eb2.q80.tadmc@tadmc30.sbcglobal.net>

Bill H <bill@ts1000.us> wrote:
> On Jul 18, 2:20 pm, invincible <imanuk2...@googlemail.com> wrote:

>> <tr><td>Almstrong</td><td>Cust Name</td><td>Shit Bing</td><td>Liabel
>> Support Team</td><td>Number:</td></tr>

> Did you type this in or do you really have a field called "<td>Shit
> Bing</td>"?


If it was for testing, then everybody knows you should use:

   <td>Rich Bastard</td>


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: Sat, 19 Jul 2008 00:41:32 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: how to create a hash whose key is a reference
Message-Id: <cam7l5-v8n.ln1@osiris.mauzo.dyndns.org>


Quoth "freesoft12@gmail.com" <freesoft12@gmail.com>:
> 
> I am creating 2 hash tables. In the first hash table I have a string
> as the key but in the second one I want the reference to that string
> as the key, to save memory.

Modern versions of perl share identical hash keys between all hashes
that use that key, for exactly that reason. So: don't worry about it :).

Ben

-- 
Heracles: Vulture! Here's a titbit for you / A few dried molecules of the gall
   From the liver of a friend of yours. / Excuse the arrow but I have no spoon.
(Ted Hughes,        [ Heracles shoots Vulture with arrow. Vulture bursts into ]
 'Alcestis')        [ flame, and falls out of sight. ]         ben@morrow.me.uk


------------------------------

Date: Fri, 18 Jul 2008 13:53:34 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: How to identify a 32 or 64 bit OS?
Message-Id: <g5qvsf02hgn@news4.newsguy.com>

Ted Zlatanov wrote:
[...]
> I would recommend Leon's solution instead of mine, as I am arguing
> that the "q" template SHOULD be provided in 32-bit Perl.

It's not 32bit Perl that doesn't 'q' - it very much does - it's whether 
or not perl was compiled with 64 bit integer *support*, for example:

   cd perl-5.10.0
   ./Configure -Dprefix=/usr/local/perl5.10.0 -Duse64bitint
   make && make test && make install

That will set the option on by default. It will still ask you but it 
will already be on so you can just hit enter.

This works perfectly fine on a 32bit Linux machine.

-- 
szr 




------------------------------

Date: Fri, 18 Jul 2008 12:01:27 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: reliability problem with Finance::QuoteHist::Yahoo
Message-Id: <g5qpa802buo@news4.newsguy.com>

Ted Byers wrote:
> On Jul 17, 6:42 am, Peter Scott <Pe...@PSDT.com> wrote:
>> On Wed, 16 Jul 2008 12:39:32 -0700, Ted Byers wrote:
>>> On Jul 16, 7:45 am, Ted Byers <r.ted.by...@gmail.com> wrote:
>>>> On Jul 16, 5:38 am, Peter Scott <Pe...@PSDT.com> wrote:
>>>>> On Fri, 11 Jul 2008 21:53:53 -0700, Ted wrote:
[attributions fixed]
>>>>>> Can't use an undefined value as an ARRAY reference at
>>>>>> C:/Perl/site/lib/ Finance/QuoteHist/Generic.pm line 863.
>>>>>
>>>>> Line 863 of the current version of that module does not
>>>>> attempt an array dereference. Consider upgrading.
>>>
>>> I am using version 1.11. I know that is about a year old,
>>> but I haven't found a more recent release. Is there one?
>>
>> Then the line number is being misreported (very unusual
>> for a run-time error):
>>
>> 859 sub target_mode {
>> 860 my $self = shift;
>> 861 if (@_) {
>> 862 $self->{target_mode} = shift;
>> 863 }
>> 864 $self->{target_mode} || $self->default_target_mode;
>> 865 }
>> 866
>>
>> Check your file.
[...]
>
> You were right.
>
> Activestate's PPM repository was out of date even though it
> said it was providing version 1.11.  Activestate's version
> was in fact 1.10.
>
> I uninstalled it and installed from another repository (and
> verified by looking in the files that I DID get version 1.11
> this time), and all problems went away.

If you have a c compiler (do you have Vidual Studio?) you can just get 
the newest tarball from CPAN itself and build it directly. I personally 
stopped trusting ActiveState's repository long ago and have never relaly 
had any problem building modules myself, just as I can on a Linux 
system. This also allows you to get your hands on newer versions, as 
ActiveState is notorious for lagging behind.

-- 
szr 




------------------------------

Date: Fri, 18 Jul 2008 13:21:48 -0700 (PDT)
From: Ted Byers <r.ted.byers@gmail.com>
Subject: Re: reliability problem with Finance::QuoteHist::Yahoo
Message-Id: <a43fc142-64c4-4db1-99f4-2cc0fcf8c828@x35g2000hsb.googlegroups.com>

On Jul 18, 3:01=A0pm, "szr" <sz...@szromanMO.comVE> wrote:
> Ted Byers wrote:
> > On Jul 17, 6:42 am, Peter Scott <Pe...@PSDT.com> wrote:
> >> On Wed, 16 Jul 2008 12:39:32 -0700, Ted Byers wrote:
> >>> On Jul 16, 7:45 am, Ted Byers <r.ted.by...@gmail.com> wrote:
> >>>> On Jul 16, 5:38 am, Peter Scott <Pe...@PSDT.com> wrote:
> >>>>> On Fri, 11 Jul 2008 21:53:53 -0700, Ted wrote:
>
> [attributions fixed]
>
>
>
>
>
> >>>>>> Can't use an undefined value as an ARRAY reference at
> >>>>>> C:/Perl/site/lib/ Finance/QuoteHist/Generic.pm line 863.
>
> >>>>> Line 863 of the current version of that module does not
> >>>>> attempt an array dereference. Consider upgrading.
>
> >>> I am using version 1.11. I know that is about a year old,
> >>> but I haven't found a more recent release. Is there one?
>
> >> Then the line number is being misreported (very unusual
> >> for a run-time error):
>
> >> 859 sub target_mode {
> >> 860 my $self =3D shift;
> >> 861 if (@_) {
> >> 862 $self->{target_mode} =3D shift;
> >> 863 }
> >> 864 $self->{target_mode} || $self->default_target_mode;
> >> 865 }
> >> 866
>
> >> Check your file.
> [...]
>
> > You were right.
>
> > Activestate's PPM repository was out of date even though it
> > said it was providing version 1.11. =A0Activestate's version
> > was in fact 1.10.
>
> > I uninstalled it and installed from another repository (and
> > verified by looking in the files that I DID get version 1.11
> > this time), and all problems went away.
>
> If you have a c compiler (do you have Vidual Studio?) you can just get
> the newest tarball from CPAN itself and build it directly. I personally
> stopped trusting ActiveState's repository long ago and have never relaly
> had any problem building modules myself, just as I can on a Linux
> system. This also allows you to get your hands on newer versions, as
> ActiveState is notorious for lagging behind.
>
Yes, I have Visual Studio 2005.

That is sorely tempting.

But first things first.

I am now hitting a problem with "   $fh1 =3D new IO::File "> $fname1";
It always fails at the same place, after having been successfully
executed several thousand times.  I am starting to wonder if there is
a limit on the number of times it can be called within one program.  :-
(


------------------------------

Date: Fri, 18 Jul 2008 16:07:54 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: reliability problem with Finance::QuoteHist::Yahoo
Message-Id: <4881062b$0$87078$815e3792@news.qwest.net>

Ted Byers wrote:
[...]
> I am now hitting a problem with "   $fh1 = new IO::File "> $fname1";
> It always fails at the same place, after having been successfully
> executed several thousand times.  I am starting to wonder if there is
> a limit on the number of times it can be called within one program.  :-
> (

This is a totally different issue, one that will require you to
post your code and a different subject, if you want any help.

Spend some time trying to debug it yourself.  Make sure you're
closing the file and that the close was successful.


------------------------------

Date: Fri, 18 Jul 2008 22:20:14 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: SOS...on system command
Message-Id: <e077l5xui7.ln2@carpet.zombinet>

cyrusgreats@gmail.com wrote:
> On Jul 17, 1:45 pm, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
> wrote:
>> cyrusgre...@gmail.com wrote:
*SKIP*
>> > my @output= `snmpwalk -c public -v 1 $sys  .1 |grep \"truncating\"`;
*SKIP*
> 1. why it print everything right after this "my @output= `snmpwalk -c
> public -v 1 $sys  .1 |grep \"truncating\"`; " instead of storing it
> into @output array
> 2. Why the @output is empty?

In case you are B<absolutely> sure that I<@output> is empty (prove you
are), then (if my crystal globe doesn't joke this time) I would
investigate if B<snmpwalk> uses C<STDOUT> for output (instead of some
other handle).

-- 
Torvalds' goal for Linux is very simple: World Domination


------------------------------

Date: Fri, 18 Jul 2008 19:30:11 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: understading double scalar variable $$
Message-Id: <x7iqv36ldp.fsf@mail.sysarch.com>

>>>>> "PL" == Paul Lalli <mritty@gmail.com> writes:

  PL> On Jul 18, 12:59 pm, Uri Guttman <u...@stemsystems.com> wrote:
  >> 
  >>   >> sub parse_text()
  >>   >> {
  >>   >>     my($text) = @_;
  >> 
  >> it still works if the prototype hasn't been seen at the time of the
  >> call.
  >> 
  >> perl -wle 'foo(2); sub foo(){print "@_"}'
  >> 2

  PL> Yes, but that implies that the coder is either not using or ignoring
  PL> warnings:
  PL> $ perl -wle 'foo(2); sub foo(){print "@_"}'
  PL> main::foo() called too early to check prototype at -e line 1.
  PL> 2

i didn't check warnings because i never use prototypes :)

  PL> which gives even more credence to...

  >> but i agree, fire the coder.

and fire his whole family. and his ancestors.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


------------------------------

Date: Fri, 18 Jul 2008 16:28:09 -0700 (PDT)
From: Slickuser <slick.users@gmail.com>
Subject: Re: understading double scalar variable $$
Message-Id: <150241a3-c7cc-416f-83e8-4e924df60e1a@h1g2000prh.googlegroups.com>



#This is the correct of calling the subroutine?
&parse_text(" A");
#$text will be "A"

Isn't that how you define a sub routine? sub parse_text() { }


sub parse_text()
{
    my($text) = @_;
    if ($text)
    {
      $$text =~ s/^\s+//;
      $$text =~ s/\s+$//;
    }
    else
    {
      s/^\s+//;
      s/\s+$//;
    }

}


------------------------------

Date: Sat, 19 Jul 2008 01:42:19 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: understading double scalar variable $$
Message-Id: <ksg2849ddd2cbeuvjrafp4gkcg99mtep4b@4ax.com>

Slickuser <slick.users@gmail.com> wrote:
>#This is the correct of calling the subroutine?
>&parse_text(" A");

Only if you want the functionality that is provided by &.
If you don't know what that functionality is, then you don't want it.

And why are you using interpolating quotes if there is nothing to
interpolate in the text?

>#$text will be "A"

No, it won't. The text will be ' A', not 'A'.

>Isn't that how you define a sub routine? sub parse_text() { }

That is how you define a subroutine _with_ a prototype. 

>sub parse_text()
>{
>    my($text) = @_;
[...]

However why on earth would you define a subroutine with an empty
prototype if
a) the first thing you do in the sub is extracting the argument (which
doesn't exist according to the prototype)
b) and when calling the sub you are using the & notion to override the
prototype anyway

This is like demanding from a car dealer to have a car's paint changed
from green to red only for you to repaint the car back to green the
moment you drive off the lot. It doesn't serve any useful purpose.

jue


------------------------------

Date: Fri, 18 Jul 2008 19:38:22 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: understading double scalar variable $$
Message-Id: <slrng82dru.q80.tadmc@tadmc30.sbcglobal.net>

Slickuser <slick.users@gmail.com> wrote:
>
>
> #This is the correct of calling the subroutine?
> &parse_text(" A");


It is a bad idea to use an ampersand on subroutine calls.


> #$text will be "A"


There *is no* variable named $text here.

By this point in your "program" it has gone out of scope.

The trimmed string cannot be accessed.

It is worthless.

What is the point of trimming a string only to immediately
discard the newly trimmed string?

There is something you are not showing us.


> Isn't that how you define a sub routine? sub parse_text() { }


That is how you define a subroutine that has a prototype.

It is a bad idea to define subroutines that have prototypes.

You should learn how to define a subroutine that does
not use prototypes.

If you need to understand Perl's subroutines you should start
with reading the documentation for Perl's subroutines:

   perldoc perlsub


> sub parse_text()
> {
>     my($text) = @_;
>     if ($text)
>     {
>       $$text =~ s/^\s+//;
>       $$text =~ s/\s+$//;
>     }
>     else
>     {
>       s/^\s+//;
>       s/\s+$//;
>     }
>
> }


First we get a code snippet.

Then we get a few more lines.

Then we get a few more lines.

Can we detect a pattern here?



Please post a short and complete program *that we can run* that
illustrates the problem you are having.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 1732
***************************************


home help back first fref pref prev next nref lref last post