[29586] in Perl-Users-Digest
Perl-Users Digest, Issue: 830 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 7 16:09:44 2007
Date: Fri, 7 Sep 2007 13:09:10 -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, 7 Sep 2007 Volume: 11 Number: 830
Today's topics:
Re: Ensuring parent/child processes xhoster@gmail.com
Re: Function notation with mysql <spamtrap@dot-app.org>
Re: Function notation with mysql <allergic-to-spam@no-spam-allowed.org>
Re: Function notation with mysql <usenet@larseighner.com>
Re: Function notation with mysql xhoster@gmail.com
Re: Function notation with mysql <kkeller-usenet@wombat.san-francisco.ca.us>
Re: Function notation with mysql <usenet@larseighner.com>
Re: Function notation with mysql <glex_no-spam@qwest-spam-no.invalid>
Net::Sftp <gil.kovary@gmail.com>
Re: Net::Sftp <1usa@llenroc.ude.invalid>
Re: Perl variable to shell command...? <rohit.makasana@gmail.com>
Re: Regular Expression <klaus03@gmail.com>
Re: Regular Expression <fritz-bayer@web.de>
Re: Switching with case in perl ? <ben@morrow.me.uk>
Temporary filename <bill@ts1000.us>
Re: Temporary filename <mritty@gmail.com>
Re: Temporary filename <m@rtij.nl.invlalid>
Re: Temporary filename <ben@morrow.me.uk>
Re: Temporary filename <bill@ts1000.us>
Re: trying to export some utility methods, and struggli <spamtrap@dot-app.org>
Re: trying to export some utility methods, and struggli <paduille.4061.mumia.w+nospam@earthlink.net>
usenet posting of perl release <dsimil@gmail.com>
Re: variable running once <glex_no-spam@qwest-spam-no.invalid>
Re: variable running once <mritty@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 07 Sep 2007 18:34:33 GMT
From: xhoster@gmail.com
Subject: Re: Ensuring parent/child processes
Message-Id: <20070907143435.833$xZ@newsreader.com>
jrpfinch <jrpfinch@gmail.com> wrote:
> How does this look? The only thing I am worried about is if another
> external process happens to inherit the pid of one of the processes I
> am about to kill (i.e. it has died already). Is there any way of
> making sure the kill -9 is killing a child process and not killing
> some other process (this is obviously tiny likelihood but you never
> know!)
You could have the parent kill itself with a negative signal:
kill -15, $$;
This should kill all of it's children and grandchildren (as long as they
haven't called POSIX::setsid) without having to worry about the specific
pids of the children. But this may be OS dependent. It works for me on
linux. Also, I wouldn't use 9 to kill something unless there is a good
reason to. 15 is usually good enough.
> eval {
> require "PAR.pm";
> import PAR q(/opt/perl5.8.8/lib/site_perl/*.par);
> for $package (@packages)
> {
> (my $pkg = $package) =~ s|::|/|g; # require need a path
> require "$pkg.pm";
> import $package;
> }
>
> };
It looks to me (again, on my system) like most of the bulk of PAR.pm is due
to the shared libraries it loads. This data is shared among all processes,
so there really isn't much to be gained by reducing the number of processes
that load PAR simultaneously.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Fri, 07 Sep 2007 11:30:56 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Function notation with mysql
Message-Id: <m2myvy5w7j.fsf@dot-app.org>
Lars Eighner <usenet@larseighner.com> writes:
> I'd like to work in perl, but it appears the Mysql module has been eaten by
> DBI so it will no longer recognize funtion notation. Is there any
> procedural-type library for interfacing with Mysql?
Why? Are you fraid your head will explode if you type "->" too many times?
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Fri, 7 Sep 2007 18:41:25 +0200 (CEST)
From: Jim Cochrane <allergic-to-spam@no-spam-allowed.org>
Subject: Re: Function notation with mysql
Message-Id: <slrnfe2vpk.5dq.allergic-to-spam@no-spam-allowed.org>
On 2007-09-07, Sherm Pendley <spamtrap@dot-app.org> wrote:
> Lars Eighner <usenet@larseighner.com> writes:
>
>> I'd like to work in perl, but it appears the Mysql module has been eaten by
>> DBI so it will no longer recognize funtion notation. Is there any
>> procedural-type library for interfacing with Mysql?
>
> Why? Are you fraid your head will explode if you type "->" too many times?
>
> sherm--
>
Maybe he has a repetitive motion syndrome, but only in finger number 4
(counting the thumb as finger # 1) of his right hand. :-)
--
------------------------------
Date: 07 Sep 2007 16:45:11 GMT
From: Lars Eighner <usenet@larseighner.com>
Subject: Re: Function notation with mysql
Message-Id: <slrnfe300l.2u5e.usenet@debranded.larseighner.com>
In our last episode,
<m2myvy5w7j.fsf@dot-app.org>,
the lovely and talented Sherm Pendley
broadcast on comp.lang.perl.misc:
> Lars Eighner <usenet@larseighner.com> writes:
>> I'd like to work in perl, but it appears the Mysql module has been eaten by
>> DBI so it will no longer recognize funtion notation. Is there any
>> procedural-type library for interfacing with Mysql?
> Why? Are you fraid your head will explode if you type "->" too many times?
No, I am afraid of broken stuff that I cannot fix. Hey, like GUIs, objects
are fine if you want to do exactly what developers think you should want to
do exactly the way they think everyone should want to do them.
--
Lars Eighner <http://larseighner.com/> <http://myspace.com/larseighner>
Countdown: 500 days to go.
What do you do when you're debranded?
------------------------------
Date: 07 Sep 2007 18:51:12 GMT
From: xhoster@gmail.com
Subject: Re: Function notation with mysql
Message-Id: <20070907145114.813$qD@newsreader.com>
Lars Eighner <usenet@larseighner.com> wrote:
> In our last episode,
> <m2myvy5w7j.fsf@dot-app.org>,
> the lovely and talented Sherm Pendley
> broadcast on comp.lang.perl.misc:
>
> > Lars Eighner <usenet@larseighner.com> writes:
>
> >> I'd like to work in perl, but it appears the Mysql module has been
> >> eaten by DBI so it will no longer recognize funtion notation. Is
> >> there any procedural-type library for interfacing with Mysql?
>
> > Why? Are you fraid your head will explode if you type "->" too many
> > times?
>
> No, I am afraid of broken stuff that I cannot fix. Hey, like GUIs,
> objects are fine if you want to do exactly what developers think you
> should want to do exactly the way they think everyone should want to do
> them.
You could always invoke the code thingies in subroutine form rather than
method form if that makes you happy, but I suspect you are just delight in
being unhappy.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Fri, 7 Sep 2007 12:03:13 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Function notation with mysql
Message-Id: <hsj8r4xbc6.ln2@goaway.wombat.san-francisco.ca.us>
On 2007-09-07, Lars Eighner <usenet@larseighner.com> wrote:
>
> No, I am afraid of broken stuff that I cannot fix. Hey, like GUIs, objects
> are fine if you want to do exactly what developers think you should want to
> do exactly the way they think everyone should want to do them.
I suppose this is true, but if you're simply generating queries, there
is only a small handful of methods you'll need to use (e.g., connect,
prepare, execute, fetch, do). Much of the rest of DBI is syntactic
sugar and convenience methods, which you can safely not use.
--keith
--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information
------------------------------
Date: 07 Sep 2007 19:38:47 GMT
From: Lars Eighner <usenet@larseighner.com>
Subject: Re: Function notation with mysql
Message-Id: <slrnfe3a5o.175.usenet@debranded.larseighner.com>
In our last episode, <hsj8r4xbc6.ln2@goaway.wombat.san-francisco.ca.us>, the
lovely and talented Keith Keller broadcast on comp.lang.perl.misc:
> On 2007-09-07, Lars Eighner <usenet@larseighner.com> wrote:
>>
>> No, I am afraid of broken stuff that I cannot fix. Hey, like GUIs, objects
>> are fine if you want to do exactly what developers think you should want to
>> do exactly the way they think everyone should want to do them.
> I suppose this is true, but if you're simply generating queries, there
> is only a small handful of methods you'll need to use (e.g., connect,
> prepare, execute, fetch, do). Much of the rest of DBI is syntactic
> sugar and convenience methods, which you can safely not use.
Well, I have rethought this, and decided that I can probably write the
functions I need using backtick calls to the mysql client. I did something
rather rash and actually read man mysql, discovering that if I don't call it
interactively, I don't have to try to parse the ASCII tables.
--
Lars Eighner <http://larseighner.com/> <http://myspace.com/larseighner>
Countdown: 500 days to go.
What do you do when you're debranded?
------------------------------
Date: Fri, 07 Sep 2007 14:51:15 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Function notation with mysql
Message-Id: <46e1abb4$0$509$815e3792@news.qwest.net>
Lars Eighner wrote:
[...]
> Well, I have rethought this, and decided that I can probably write the
> functions I need using backtick calls to the mysql client. I did something
> rather rash and actually read man mysql, discovering that if I don't call it
> interactively, I don't have to try to parse the ASCII tables.
>
Yuck. Nothing is stopping you from going against the advice others
are giving, but there's no need to tell anyone that's what you're
doing. :-)
DBI is pretty nice and there are a lot of tutorials and documentation
available to make using it, pretty painless.
------------------------------
Date: Fri, 07 Sep 2007 16:35:46 -0000
From: gil <gil.kovary@gmail.com>
Subject: Net::Sftp
Message-Id: <1189182946.304387.5760@r34g2000hsd.googlegroups.com>
Hi,
I'm trying to use Net::Sftp on windows XP,
I already downloaded Net::SSH::W32Perl and Net::Sftp.
the thing is - when trying to use, I get this error message yelling
about the use of "getpid()" on SSH/Perl.pm, when disabling the line -
some local variable $home isn't initialized.
does some one know how can I make theses two fellows (SSH, Sftp) work
harmonically on windows?
thanks,
Gil
------------------------------
Date: Fri, 07 Sep 2007 16:52:54 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Net::Sftp
Message-Id: <Xns99A482FDDCC5Easu1cornelledu@127.0.0.1>
gil <gil.kovary@gmail.com> wrote in news:1189182946.304387.5760
@r34g2000hsd.googlegroups.com:
> Hi,
>
> I'm trying to use Net::Sftp on windows XP,
> I already downloaded Net::SSH::W32Perl and Net::Sftp.
>
> the thing is - when trying to use, I get this error message yelling
> about the use of "getpid()" on SSH/Perl.pm, when disabling the line -
> some local variable $home isn't initialized.
Please read the posting guidelines and show a small example.
Does setting $ENV{HOME} to something meaningful help?
> does some one know how can I make theses two fellows (SSH, Sftp) work
> harmonically on windows?
ITYM "harmoniously"
http://en.wikipedia.org/wiki/Harmonic
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>
------------------------------
Date: Fri, 07 Sep 2007 18:37:42 -0000
From: Rohit <rohit.makasana@gmail.com>
Subject: Re: Perl variable to shell command...?
Message-Id: <1189190262.334814.63250@22g2000hsm.googlegroups.com>
On Sep 6, 7:06 am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth Josef Moellers <josef.moell...@fujitsu-siemens.com>:
>
>
>
> > Benoit Lefebvre wrote:
> > > On Sep 4, 5:55 pm,Rohit<rohit.makas...@gmail.com> wrote:
>
> > >>$filename=myFile.txt
>
> > >>@fileRec=`cat $filename`;
>
> > >>Here shell is not able to identify $filename variable. Any idea or
> > >>suggestions?
>
> > > I like to do it that way
>
> > > $filename = "myfile.txt";
>
> > > $cmd = "cat ". $filename;
>
> > > @fileRec = `$cmd`;
>
> > While this is how I'd do it, too (I can then show the entire command for
> > debugging purposes),
>
> For cases when you need an external command, I'd agree. This is not one
> of them: perl is perfectly capable of reading a file on its own:
>
> my @fileRec = do {
> open my $FH, '<', 'myFile.txt'
> or die "can't read 'myFile.txt': $!";
> <$FH>;
> };
>
> or indeed
>
> use File::Slurp qw/read_file/;
>
> my @fileRec = read_file 'myFile.txt';
>
> > Most likeley, the file isn't accessable, e.g. because it's in a
> > different path or it is read-protected, or the OP isn't telling us
> > everything, as his code is not valid Perl anyway.
>
> ...except it is, it just doesn't mean what he thinks it does:
>
> ~% perl -le'print myFile.txt'
> myFiletxt
> ~%
>
> 'myFile' and 'txt' are autoquoted, and the . concatenates them. Yet
> another reason why you should always use strictures: in this case, the
> rather perversely-named strict 'subs' (it should clearly be strict
> 'strings') rather than the usual strict 'vars'.
>
> Ben
Yupe, thanks everyone. I have replace entirely replaced my code..
for ($fileCount = 0; $fileCount < 3; $fileCount++) {
$symbolFile = $symbolBreakpadFile[$fileCount];
open SYMBFILEHANDLE, "< $symbolFile" or die $!;
@funcRec= <SYMBFILEHANDLE>;
open FHANDLE, "> $SymbolPlistFile[$fileCount]" or die $!;
myMain();
close(SYMBFILEHANDLE);
}
Thanks again for your time and pointing out my mistakes, which I could
have never identified.
Thanks, Rohit
It's a journey from Learning to Learning....which never ends...!
------------------------------
Date: Fri, 07 Sep 2007 08:28:58 -0700
From: Klaus <klaus03@gmail.com>
Subject: Re: Regular Expression
Message-Id: <1189178938.282107.138610@o80g2000hse.googlegroups.com>
On Sep 7, 4:51 pm, "fritz-ba...@web.de" <fritz-ba...@web.de> wrote:
> On 7 Sep., 17:41, Klaus <klau...@gmail.com> wrote:
>
> > On Sep 7, 2:28 pm, "fritz-ba...@web.de" <fritz-ba...@web.de> wrote:
>
> > > I 'm looking for a regular expression, which will find a certain word
> > > in a text and replace it, if and only if it does not appear inside an
> > > a html link or inside a tag
>
> > see Perlfaq 4 - How do I find matching/nesting anything?
[ snip contents of Perlfaq 4 ]
> Well, I would know if it's possible, but positive and negative
> lookaheads seem to be something to consider. The following shows how:
>
> http://frank.vanpuffelen.net/2007/04/how-to-optimize-regular-expression.html
The document claims:
" [...] apparently there aren't many good HTML parsers available
for .NET [...] "
That might be true for .NET, but as far as Perl is concerned, there
are many HTML parsers available on CPAN, and HTML::Parser looks
perfect for the job (although I would have to admit that I haven't yet
tested it myself) :
http://search.cpan.org/~gaas/HTML-Parser-3.56/Parser.pm
========================================
Here is an extract from the HTML::Parser documentation:
========================================
HTML::Parser is not a generic SGML parser. We have tried to make it
able to deal with the HTML that is actually "out there", and it
normally parses as closely as possible to the way the popular web
browsers do it instead of strictly following one of the many HTML
specifications from W3C. Where there is disagreement, there is often
an option that you can enable to get the official behaviour.
The document to be parsed may be supplied in arbitrary chunks. This
makes on-the-fly parsing as documents are received from the network
possible.
If event driven parsing does not feel right for your application, you
might want to use HTML::PullParser. This is an HTML::Parser subclass
that allows a more conventional program structure.
========================================
--
Klaus
------------------------------
Date: Fri, 07 Sep 2007 11:17:49 -0700
From: "fritz-bayer@web.de" <fritz-bayer@web.de>
Subject: Re: Regular Expression
Message-Id: <1189189069.204613.169550@w3g2000hsg.googlegroups.com>
On 7 Sep., 18:28, Klaus <klau...@gmail.com> wrote:
> On Sep 7, 4:51 pm, "fritz-ba...@web.de" <fritz-ba...@web.de> wrote:
>
> > On 7 Sep., 17:41, Klaus <klau...@gmail.com> wrote:
>
> > > On Sep 7, 2:28 pm, "fritz-ba...@web.de" <fritz-ba...@web.de> wrote:
>
> > > > I 'm looking for a regular expression, which will find a certain word
> > > > in a text and replace it, if and only if it does not appear inside an
> > > > a html link or inside a tag
>
> > > see Perlfaq 4 - How do I find matching/nesting anything?
>
> [ snip contents of Perlfaq 4 ]
>
> > Well, I would know if it's possible, but positive and negative
> > lookaheads seem to be something to consider. The following shows how:
>
> >http://frank.vanpuffelen.net/2007/04/how-to-optimize-regular-expressi...
>
> The document claims:
> " [...] apparently there aren't many good HTML parsers available
> for .NET [...] "
>
> That might be true for .NET, but as far as Perl is concerned, there
> are many HTML parsers available on CPAN, and HTML::Parser looks
> perfect for the job (although I would have to admit that I haven't yet
> tested it myself) :
>
> http://search.cpan.org/~gaas/HTML-Parser-3.56/Parser.pm
>
> ========================================
> Here is an extract from the HTML::Parser documentation:
> ========================================
> HTML::Parser is not a generic SGML parser. We have tried to make it
> able to deal with the HTML that is actually "out there", and it
> normally parses as closely as possible to the way the popular web
> browsers do it instead of strictly following one of the many HTML
> specifications from W3C. Where there is disagreement, there is often
> an option that you can enable to get the official behaviour.
>
> The document to be parsed may be supplied in arbitrary chunks. This
> makes on-the-fly parsing as documents are received from the network
> possible.
>
> If event driven parsing does not feel right for your application, you
> might want to use HTML::PullParser. This is an HTML::Parser subclass
> that allows a more conventional program structure.
> ========================================
>
> --
> Klaus
I'm looking for a regular expression, which is plattform independet
and works for java, perl or net.
------------------------------
Date: Fri, 7 Sep 2007 18:34:53 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Switching with case in perl ?
Message-Id: <tme8r4-kun1.ln1@osiris.mauzo.dyndns.org>
Quoth Paul Lalli <mritty@gmail.com>:
> On Sep 7, 10:41 am, lerameur <leram...@yahoo.com> wrote:
> > I used the switching command CASE in c++
> > Is there such a thing in perl.?
>
> Yes. perldoc Switch.
Please don't recommend Switch.pm to people. It has serious bugs (due to
being implemented as source filter); e.g.
#!/usr/bin/perl
use Switch;
sub foo ($) {
switch ($_[0]) {
case 1 { print "OK\n" }
}
}
foo(1);
__END__
with Switch-2.13 (the latest version) fails with
Number found where operator expected at sw line 7, near "case 1"
(Do you need to predeclare case?)
syntax error at sw line 6, near ") {"
syntax error at sw line 8, near "}"
Execution of sw aborted due to compilation errors.
as Switch (or rather Text::Balanced) confuses '($)' with '$)' and loses
the close bracket on the prototype. There have been lots of other bugs
like this in the past: some have been fixed, but there are undoubtedly
many more left. The faq has been updated on faq.perl.org to reflect this
fact; unfortuately, there's no way to update all the copies of perlfaq7
installed on people's machines :).
If you really really really need a switch statement, wait for 5.10
(RealSoonNow :) ) which has one in the form of a Perl6ish given/when;
otherwise, stick to the other solutions in the FAQ.
<lots of good sense snipped>
Ben
------------------------------
Date: Fri, 07 Sep 2007 09:25:02 -0700
From: Bill H <bill@ts1000.us>
Subject: Temporary filename
Message-Id: <1189182302.502725.279160@r34g2000hsd.googlegroups.com>
I have seen the FAQ on creating a temporary filename, but is there
anyway of make them self-delete after a certain time period (probably
not, but you guys have done some amazing stuff with perl)?
Bill H
------------------------------
Date: Fri, 07 Sep 2007 09:34:47 -0700
From: Paul Lalli <mritty@gmail.com>
Subject: Re: Temporary filename
Message-Id: <1189182887.173761.290840@50g2000hsm.googlegroups.com>
On Sep 7, 12:25 pm, Bill H <b...@ts1000.us> wrote:
> I have seen the FAQ on creating a temporary filename, but is
> there anyway of make them self-delete after a certain time
> period (probably not, but you guys have done some amazing stuff
> with perl)?
What about alarm() and $SIG{ALRM} ?
perldoc -f alarm
perldoc perlipc
Paul Lalli
------------------------------
Date: Fri, 7 Sep 2007 19:35:39 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: Temporary filename
Message-Id: <pan.2007.09.07.17.35.21@rtij.nl.invlalid>
On Fri, 07 Sep 2007 09:25:02 -0700, Bill H wrote:
> I have seen the FAQ on creating a temporary filename, but is there
> anyway of make them self-delete after a certain time period (probably
> not, but you guys have done some amazing stuff with perl)?
On *nix, delete the directory entry but keep the filehandle. The file
will be gone once you close the filehandle.
M4
------------------------------
Date: Fri, 7 Sep 2007 18:43:47 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Temporary filename
Message-Id: <j7f8r4-kun1.ln1@osiris.mauzo.dyndns.org>
Quoth Bill H <bill@ts1000.us>:
> I have seen the FAQ on creating a temporary filename, but is there
> anyway of make them self-delete after a certain time period (probably
> not, but you guys have done some amazing stuff with perl)?
If you just want to make sure the file goes away when you've finished
with it, you can use the File::Temp module. Otherwise, please give more
details on what you are trying to accomplish; unless
system qq{sleep 5 && rm -f "$file" &};
does what you want. In general you will need to have a process hanging
around to remove the file for you.
Ben
------------------------------
Date: Fri, 07 Sep 2007 12:12:46 -0700
From: Bill H <bill@ts1000.us>
Subject: Re: Temporary filename
Message-Id: <1189192366.491192.214460@19g2000hsx.googlegroups.com>
On Sep 7, 1:43 pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth Bill H <b...@ts1000.us>:
>
> > I have seen the FAQ on creating a temporary filename, but is there
> > anyway of make them self-delete after a certain time period (probably
> > not, but you guys have done some amazing stuff with perl)?
>
> If you just want to make sure the file goes away when you've finished
> with it, you can use the File::Temp module. Otherwise, please give more
> details on what you are trying to accomplish; unless
>
> system qq{sleep 5 && rm -f "$file" &};
>
> does what you want. In general you will need to have a process hanging
> around to remove the file for you.
>
> Ben
I was having a hard time figuring out how to explain it, and realized
that what I need to do has to be done in the software, ie creating the
temporary file (a jpg image) and then deleting that one and creating a
new one (with a new name) when things change, while keeping track of
what file is "current" in a different file (in this case an XML). I
was hoping to have some way of having the old, replaced, unused files
(with obsolete filenames) "go away" on their own but I suppose a file
system hasn't progressed to the point of being able to use it like
memory where you "allocate" a block of memory and when done using it
you can "unallocate" it and it "goes away".
Bill H
------------------------------
Date: Fri, 07 Sep 2007 11:28:33 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: trying to export some utility methods, and struggling
Message-Id: <m2r6la5wbi.fsf@dot-app.org>
bugbear <bugbear@trim_papermule.co.uk_trim> writes:
> (reponse at bottom)
That's where we expect it to be - no need to point it out.
> Mumia W. wrote:
>
>> # Let's say we're back in the main program now.
>>
>> WidgetBasher->utility_function();
>> WidgetManip->utility_function();
>> WidgetDoer->utility_function();
>
> Yep, that works, but that's almost exactly what I'm trying to avoid.
> I don't want to be forced to have an instance of a class
> just to call a utility;
Good thing that calling a class method doesn't force that.
> I am aware of the various uses of OO code (I've spent 15 years
> on large projects in both Java and C++)
And in all that time you've never heard of class methods?
Astonishing.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Fri, 07 Sep 2007 14:01:10 -0500
From: "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net>
Subject: Re: trying to export some utility methods, and struggling
Message-Id: <13e38ncem52iua1@corp.supernews.com>
On 09/07/2007 06:27 AM, bugbear wrote:
> [...]
> I am aware of the various uses of OO code (I've spent 15 years
> on large projects in both Java and C++), but this is not a large
> project.
>
Okay. What is causing you confusion then? Using the Exporter is too easy.
Without showing any code, you'll probably only get the most general
answers possible.
------------------------------
Date: Fri, 07 Sep 2007 12:04:07 -0700
From: simil <dsimil@gmail.com>
Subject: usenet posting of perl release
Message-Id: <1189191847.903779.219360@d55g2000hsg.googlegroups.com>
"Larry Wall released the first released version 1.0 of perl to the
comp.sources.misc newsgroup on December 18, 1987". Almost everybody
must have seen this line when they first start learning perl. But
where the hell is that posting? I have been trying to find out that
posting but in vain. Can anybody point me to that? I am just curious.
simil
------------------------------
Date: Fri, 07 Sep 2007 10:14:24 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: variable running once
Message-Id: <46e16ad0$0$493$815e3792@news.qwest.net>
lerameur wrote:
> Hello
>
> I just wrote a small script. I would like to know if the following is
> possible:
> I want to have some initial values like a time in the script. This
> script is called from crontab every hour. These initial values should
> be run only once when the script starts. Is there such a command in
> perl ?
> I thought of putting theses values in a separate file and when the
> perl program starts, fetches those values and when it exist saves the
> newest value so when it is called again it continues where it has
> left off.
That's how you'd do it in any language. You have to store the
values somewhere because once the process exits, they're gone.
------------------------------
Date: Fri, 07 Sep 2007 08:23:44 -0700
From: Paul Lalli <mritty@gmail.com>
Subject: Re: variable running once
Message-Id: <1189178624.274625.96250@y42g2000hsy.googlegroups.com>
On Sep 7, 11:03 am, lerameur <leram...@yahoo.com> wrote:
> Hello
>
> I just wrote a small script. I would like to know if the following is
> possible:
> I want to have some initial values like a time in the script. This
> script is called from crontab every hour. These initial values should
> be run only once when the script starts. Is there such a command in
> perl ?
> I thought of putting theses values in a separate file and when the
> perl program starts, fetches those values and when it exist saves the
> newest value so when it is called again it continues where it has
> left off.
Are you looking for the time() function? perldoc -f time.
If not, please post a short-but-complete example of what it is you're
trying to do.
Paul Lalli
------------------------------
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 830
**************************************