From doc at redbrick.dcu.ie Tue May 4 06:45:31 2004 From: doc at redbrick.dcu.ie (Dave O Connor) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] Coding Standards Documentation Message-ID: <20040504114531.GA18006@carbon.redbrick.dcu.ie> I've been asked to write (that is, it has been placed upon my ever-growing plate to write) a set of coding standards for perl code. This is for small parts of a system that are being written in perl (and since java and c++ have well-defined coding standards in the project, so should perl). I write fairly consistent perl, but I'm wondering if anyone has come across a good standard coding practice document, geared toward perl? I'm talking everything from using strict, down to variable naming and bracketing standards. - DoC From John.MCNAMARA at snamprogetti.eni.it Tue May 4 06:57:27 2004 From: John.MCNAMARA at snamprogetti.eni.it (John.MCNAMARA@snamprogetti.eni.it) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] Coding Standards Documentation Message-ID: > I write fairly consistent perl, but I'm wondering if anyone has come > across a good standard coding practice document, geared > toward perl? The perlstyle man page is a good place to start. And to help enforce Perl coding practices perltidy is a good tool. http://perltidy.sourceforge.net/ John. -- *************************E-MAIL CONFIDENTIALITY FOOTER********************** This message may contain confidential information and must not be copied, disclosed or used by anybody other than the intended recipient. If you have received this message in error, please notify us writing to postmaster@snamprogetti.eni.it and delete the message and any copies of it. Thank you for your assistance. From abarnes+dublin-pm at mosina.com.au Tue May 4 16:57:10 2004 From: abarnes+dublin-pm at mosina.com.au (Andrew Barnes) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] "Compiled" Code Message-ID: <2171.82.141.207.123.1083707830.squirrel@webmail.ramsesit.com> Hi All, I'm just wondering - how does one go about "compiling" one's perl code into a binary distributable format? And next part - perhaps more importantly, under what circumstances would one go about doing this? Pros, Cons, etc Cheers, Andrew P.S. Thanks for the help on IRC this evening DoC :-) -- Andrew Barnes Dublin Perl Mongers W: http://dublin.pm.org M: andrewbarnes@ramsesit.com M: +353873803633 PGP Fingerprint: 2C8E E948 C62D 8C2C 48E3 0925 6ED3 78AA 5B17 6E26 From daveb at esat.net Tue May 4 17:12:29 2004 From: daveb at esat.net (Dave Burke) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] "Compiled" Code In-Reply-To: Message from "Andrew Barnes" of "Tue, 04 May 2004 22:57:10 BST." <2171.82.141.207.123.1083707830.squirrel@webmail.ramsesit.com> References: <2171.82.141.207.123.1083707830.squirrel@webmail.ramsesit.com> Message-ID: I've never used it but perlcc maybe what your looking for ? http://search.cpan.org/dist/perl/utils/perlcc.PL Dave "Andrew Barnes" wrote: > >Hi All, > >I'm just wondering - how does one go about "compiling" one's perl code >into a binary distributable format? > >And next part - perhaps more importantly, under what circumstances would >one go about doing this? Pros, Cons, etc > >Cheers, > Andrew > >P.S. Thanks for the help on IRC this evening DoC :-) > >-- >Andrew Barnes >Dublin Perl Mongers >W: http://dublin.pm.org >M: andrewbarnes@ramsesit.com >M: +353873803633 >PGP Fingerprint: 2C8E E948 C62D 8C2C 48E3 0925 6ED3 78AA 5B17 6E26 >_______________________________________________ >Dublin-pm mailing list - Dublin-pm@mail.pm.org >http://dublin.pm.org/ - IRC irc.linux.ie #dublin-pm > > From doc at redbrick.dcu.ie Tue May 4 17:19:20 2004 From: doc at redbrick.dcu.ie (Dave O Connor) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] "Compiled" Code In-Reply-To: <2171.82.141.207.123.1083707830.squirrel@webmail.ramsesit.com> References: <2171.82.141.207.123.1083707830.squirrel@webmail.ramsesit.com> Message-ID: <20040504221920.GA8772@carbon.redbrick.dcu.ie> Andrew Barnes said on Tue, May 04, 2004 at 10:57:10PM +0100: > Hi All, > > I'm just wondering - how does one go about "compiling" one's perl code > into a binary distributable format? perlcc - comes with perl. The source code it generates makes baby jesus cry last time I looked, but it seems to work. > > And next part - perhaps more importantly, under what circumstances would > one go about doing this? Pros, Cons, etc > Probably if you had no way of ensuring perl were installed, especially on windows (where you can't be sure any given version of perl is installed, and you don't want to worry about module dependencies, etc. The modukle dependency thing applies to *nix, too, if you want to package a binary distro, and don't want to specify a bunch of perl-specific modules and tomfoolery to install. - DoC From dave at dave.org.uk Wed May 5 00:07:41 2004 From: dave at dave.org.uk (Dave Cross) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] "Compiled" Code In-Reply-To: <2171.82.141.207.123.1083707830.squirrel@webmail.ramsesit.com> References: <2171.82.141.207.123.1083707830.squirrel@webmail.ramsesit.com> Message-ID: <20040505050741.GC19599@mag-sol.com> On Tue, May 04, 2004 at 10:57:10PM +0100, Andrew Barnes wrote: > Hi All, > > I'm just wondering - how does one go about "compiling" one's perl code > into a binary distributable format? It's not strictly speaking a bunary format, but you might wasn to look at PAR http://search.cpan.org/dist/PAR/ Dave... -- New .sigs Running in please parse From Mark.OConnor at adc.com Wed May 5 03:05:23 2004 From: Mark.OConnor at adc.com (OConnor, Mark) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] "Compiled" Code Message-ID: I would also recommend the PAR module. If you properly compile the package on your platform it can generate binaries. I think this package is actually more useful when used to generate platform independent .par files. These are compressed zip archives that contain all your programs module dependencies. I normally deploy these along with a "parl" intrepretor for the target platform. Regards, MArk -----Original Message----- From: Dave Cross [mailto:dave@dave.org.uk] Sent: 05 May 2004 06:08 To: Andrew Barnes Cc: dublin-pm@mail.pm.org Subject: Re: [Dub-pm] "Compiled" Code On Tue, May 04, 2004 at 10:57:10PM +0100, Andrew Barnes wrote: > Hi All, > > I'm just wondering - how does one go about "compiling" one's perl code > into a binary distributable format? It's not strictly speaking a bunary format, but you might wasn to look at PAR http://search.cpan.org/dist/PAR/ Dave... -- New .sigs Running in please parse _______________________________________________ Dublin-pm mailing list - Dublin-pm@mail.pm.org http://dublin.pm.org/ - IRC irc.linux.ie #dublin-pm From John.MCNAMARA at snamprogetti.eni.it Wed May 5 03:30:04 2004 From: John.MCNAMARA at snamprogetti.eni.it (John.MCNAMARA@snamprogetti.eni.it) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] "Compiled" Code Message-ID: > I'm just wondering - how does one go about "compiling" one's perl code > into a binary distributable format? In addition to PAR there is Perl2exe: http://www.indigostar.com It isn't really a compiler it just bundles the interpreter and source code together. It works well but it isn't free. There is also a similar tool from ActiveState called perlapp: http://www.ActiveState.com/Products/Productivity/Perl_Dev_Kit/index.html John. -- #!/usr/bin/perl -l # Reveal hidden message in the footer. Slowly!!. $_=join$<=>and split;@_=@_[10,19,32,39]; $_[0]^="'";$_[1]="an"|" ".$_[1]; $_[2]=~s s(.)(.)(.).+s\u\1\3r\2s;$_[3]++for+0..45543094; die"@_.$/"; __END__ *************************E-MAIL CONFIDENTIALITY FOOTER********************** This message may contain confidential information and must not be copied, disclosed or used by anybody other than the intended recipient. If you have received this message in error, please notify us writing to postmaster@snamprogetti.eni.it and delete the message and any copies of it. Thank you for your assistance. From abarnes+dublin-pm at mosina.com.au Wed May 5 15:51:31 2004 From: abarnes+dublin-pm at mosina.com.au (Andrew Barnes) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] Time::Piece && while loops Message-ID: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> Hiya Guys OK, as here's the thing I'm trying to do (sorry to repeat on ya DoC ;>) I'm working on a script that will write out TCP connection information into a log file (let's call it $logfile ;>) Let's say that $date = yymmdd; $logfile = .yymmdd-hhmmss.txt; where the time info is of course substituted with the actual numeric values of course ;> What I want this script to do is keep writing out the connection info into this same file *until* the day changes - ala "automated log rotation" ;> SOooo... when talking to Doc on IRC last night we discussed using a while loop to do this. My catch is trying to work out the "best way" (programatically, as well as "resource-wise") to do this - ie. check the day, and while $date != $date + 1, write into the log file - otherwise, update $date, $logfile, and write into the new file I hope that this makes sense, and look forward to hearing the various answers/suggestions :-) Regards, Andrew -- Andrew Barnes Dublin Perl Mongers W: http://dublin.pm.org M: andrewbarnes@ramsesit.com M: +353873803633 PGP Fingerprint: 2C8E E948 C62D 8C2C 48E3 0925 6ED3 78AA 5B17 6E26 From abarnes+dublin-pm at mosina.com.au Wed May 5 15:54:36 2004 From: abarnes+dublin-pm at mosina.com.au (Andrew Barnes) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] In-Reply-To: References: Message-ID: <3177.82.141.207.123.1083790476.squirrel@webmail.ramsesit.com> 'lo all, Thanks for the replies. perlcc sounds like it'll do the trick. And the nail was hit on the head... without realising it! One of the things I've been trying to work out is how to ensure my script will run on all machines required (where OS is the same of course ;>), while not being in direct control over the target systems, and in particular what verions of Perl they have, nor what modules have been installed Again, cheers :-) Regards, Andrew -- Andrew Barnes Dublin Perl Mongers W: http://dublin.pm.org M: andrewbarnes@ramsesit.com M: +353873803633 PGP Fingerprint: 2C8E E948 C62D 8C2C 48E3 0925 6ED3 78AA 5B17 6E26 From hostyle at csn.ul.ie Wed May 5 16:59:29 2004 From: hostyle at csn.ul.ie (Lee Hosty) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] Time::Piece && while loops In-Reply-To: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> References: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> Message-ID: <409963C1.7070001@csn.ul.ie> Andrew Barnes wrote: > > What I want this script to do is keep writing out the connection info into > this same file *until* the day changes - ala "automated log rotation" ;> > > SOooo... when talking to Doc on IRC last night we discussed using a while is there Dub.pm IRC channel? > loop to do this. My catch is trying to work out the "best way" > (programatically, as well as "resource-wise") to do this - ie. check the > day, and while $date != $date + 1, write into the log file - otherwise, > update $date, $logfile, and write into the new file I'm presuming you already have some sort of loop going for your log data (and this is obviously rather simplistic): my ($date, $time) = &get_date_and_time_as_array; open (LOG, ">>$date.$time.txt"); while ($data) { my ($newdate, $newtime) = &get_date_and_time_as_array; # get log data if ($newdate > $date) { close LOG; open (LOG, ">>$date.$time.txt"); } print LOG $data; } close LOG; How expensive is calling get_date_and_time_as_array / getting current date? Depends on the amount / speed of data being logged. -- Please excuse glaring errors; /me contains beer From nick at netability.ie Wed May 5 17:02:05 2004 From: nick at netability.ie (Nick Hilliard) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] Time::Piece && while loops In-Reply-To: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> References: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> Message-ID: <4099645D.6060803@netability.ie> > What I want this script to do is keep writing out the connection info into > this same file *until* the day changes - ala "automated log rotation" ;> > > SOooo... when talking to Doc on IRC last night we discussed using a while > loop to do this. My catch is trying to work out the "best way" > (programatically, as well as "resource-wise") to do this - ie. check the > day, and while $date != $date + 1, write into the log file - otherwise, > update $date, $logfile, and write into the new file One rather grody way of doing this is to use cacheout (in FileCache). It's not efficient, but it saves lots in terms of coding. Nick From hostyle at csn.ul.ie Wed May 5 17:15:05 2004 From: hostyle at csn.ul.ie (Lee Hosty) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] Time::Piece && while loops In-Reply-To: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> References: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> Message-ID: <40996769.3080903@csn.ul.ie> Andrew Barnes wrote: > What I want this script to do is keep writing out the connection info into > this same file *until* the day changes - ala "automated log rotation" ;> You could also use an non perl solution ala logrotate? From fergal at esatclear.ie Wed May 5 17:20:49 2004 From: fergal at esatclear.ie (Fergal Daly) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] Time::Piece && while loops In-Reply-To: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> References: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> Message-ID: <20040505222049.GA25280@dyn.fergaldaly.com> If you're worried about wasting cycles calling localtime(time()) and extracting the date on every trip through the loop then following would avoid that while ($keep_logging) { my $tomorrow = tomorrow(); while (time() < $tomorrow) { log_something(); } switch_files(); } sub tomorrow { # figures out when tomorrow starts in terms of seconds from epoch so # that it can be compared directly with a value given by time() my ($sec, $min, $hour) = localtime(time()); my $tomorrow = $now - (($hour*60) * 60 + $sec) + 24*60*60; return $tomorrow; } A more efficient solution (the most efficient?) would be to use eval{} and alarm() to set a timer to go off when tomorrow arrives but that'd be overkill and has nasty pitfalls for a very small improvement over the code above, F On Wed, May 05, 2004 at 09:51:31PM +0100, Andrew Barnes wrote: > Hiya Guys > > OK, as here's the thing I'm trying to do (sorry to repeat on ya DoC ;>) > > I'm working on a script that will write out TCP connection information > into a log file (let's call it $logfile ;>) Let's say that > > $date = yymmdd; > $logfile = .yymmdd-hhmmss.txt; > > where the time info is of course substituted with the actual numeric > values of course ;> > > What I want this script to do is keep writing out the connection info into > this same file *until* the day changes - ala "automated log rotation" ;> > > SOooo... when talking to Doc on IRC last night we discussed using a while > loop to do this. My catch is trying to work out the "best way" > (programatically, as well as "resource-wise") to do this - ie. check the > day, and while $date != $date + 1, write into the log file - otherwise, > update $date, $logfile, and write into the new file > > I hope that this makes sense, and look forward to hearing the various > answers/suggestions :-) > > Regards, > Andrew > > -- > Andrew Barnes > Dublin Perl Mongers > W: http://dublin.pm.org > M: andrewbarnes@ramsesit.com > M: +353873803633 > PGP Fingerprint: 2C8E E948 C62D 8C2C 48E3 0925 6ED3 78AA 5B17 6E26 > _______________________________________________ > Dublin-pm mailing list - Dublin-pm@mail.pm.org > http://dublin.pm.org/ - IRC irc.linux.ie #dublin-pm > > From tobinjt at netsoc.tcd.ie Wed May 5 17:50:15 2004 From: tobinjt at netsoc.tcd.ie (John Tobin) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] Time::Piece && while loops In-Reply-To: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> References: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> Message-ID: <20040505225015.GA23283@matrix.netsoc.tcd.ie> On Wed, May 05, 2004 at 09:51:31PM +0100, Andrew Barnes wrote: > SOooo... when talking to Doc on IRC last night we discussed using a while > loop to do this. My catch is trying to work out the "best way" > (programatically, as well as "resource-wise") to do this - ie. check the > day, and while $date != $date + 1, write into the log file - otherwise, > update $date, $logfile, and write into the new file How about alarm? Something like this, cleaned up a bit, should do it: while ( 1 ) { my $date = blah blah; my $logfile = File::Spec::catfile $logdir, "$date.log"; my $log = new IO::File ">> $logfile" or die "$0: failed to open $logfile\: $!\n"; my $seconds = time; my $day = 60 * 60 * 24; # the number of seconds between now and midnight my $midnight = $day - ( $seconds % $day ); # paranoia: alarm 0 means cancel the alarm, meaning we'll never # be woken up, so sleep for a second to get around that - it'll # get us past midnight. if ( $midnight == 0 ) { sleep 1; next; } eval { local $SIG{ALRM} = sub { die "it's midnight"; }; alarm $midnight; while ( <$input> ) { print $log $_ or die "$0: failed writing to ", "$logfile\: $!\n"; undef $_; } alarm 0; # we've reached eof, so exit the loop? last; }; # die for real if we couldn't write to the logfile if ( defined $@ and $@ =~ m/failed writing to/ ) { die $@; } if ( defined $_ ) { # We were interrupted between reading the next line and # undef $_; write the current line to the log, just in # case. We may get it logged twice, but that's probably # better than not getting it logged at all. print $log $_ or die "$0: failed writing to $logfile\: $!\n"; } } You may end up with a line logged twice; I don't know how important it is that it shouldn't happen. If it's really important, you could play games blocking signals, but that leaves you with the problem of the signal not waking you up in time. Tricky. -- John Tobin "It's not that I disagree with Bush's economic policy, or his foreign policy, it's that I believe he's a child of Satan here to destroy the planet earth." -- Bill Hicks From nick at netability.ie Thu May 6 03:38:34 2004 From: nick at netability.ie (Nick Hilliard) Date: Mon Aug 2 21:29:57 2004 Subject: [Dub-pm] Time::Piece && while loops In-Reply-To: <20040505225015.GA23283@matrix.netsoc.tcd.ie> References: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> <20040505225015.GA23283@matrix.netsoc.tcd.ie> Message-ID: <1083832714.95010.4.camel@localhost.netability.ie> There is a certain code clarity / readability / simplicity to using FileCache, though: use FileCache; while (1) { my $date = blah blah; my $log = cacheout "$date.log"; blah blah blah; } Nick > while ( 1 ) { > my $date = blah blah; > my $logfile = File::Spec::catfile $logdir, "$date.log"; > my $log = new IO::File ">> $logfile" > or die "$0: failed to open $logfile\: $!\n"; > my $seconds = time; > my $day = 60 * 60 * 24; > # the number of seconds between now and midnight > my $midnight = $day - ( $seconds % $day ); > # paranoia: alarm 0 means cancel the alarm, meaning we'll never > # be woken up, so sleep for a second to get around that - it'll > # get us past midnight. > if ( $midnight == 0 ) { > sleep 1; > next; > } > eval { > local $SIG{ALRM} = sub { > die "it's midnight"; > }; > alarm $midnight; > while ( <$input> ) { > print $log $_ > or die "$0: failed writing to ", > "$logfile\: $!\n"; > undef $_; > } > alarm 0; > # we've reached eof, so exit the loop? > last; > }; > # die for real if we couldn't write to the logfile > if ( defined $@ and $@ =~ m/failed writing to/ ) { > die $@; > } > if ( defined $_ ) { > # We were interrupted between reading the next line and > # undef $_; write the current line to the log, just in > # case. We may get it logged twice, but that's probably > # better than not getting it logged at all. > print $log $_ > or die "$0: failed writing to $logfile\: $!\n"; > } > } > > You may end up with a line logged twice; I don't know how important it > is that it shouldn't happen. If it's really important, you could play > games blocking signals, but that leaves you with the problem of the > signal not waking you up in time. Tricky. From sucellus at eircom.net Thu May 6 05:53:36 2004 From: sucellus at eircom.net (Gary Cosgrave) Date: Mon Aug 2 21:29:58 2004 Subject: [Dub-pm] Time::Piece && while loops References: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> <20040505222049.GA25280@dyn.fergaldaly.com> Message-ID: <409A1930.F5DDC365@eircom.net> If worried about localtime(time()) overheads - you could easily add a check to avoid it, without the perils of alarm() and eval(). Also, we can dodge DST issues with a constant, that we could even change to a low value during DST safe times of the year to maximise efficency. For instance: # Constant that is safe 365 days use constant DST_THRESHOLD => 3601; # Setup some globals my ($midnight,$current_date) = &reset_midnight(); my $current_file_date = $current_date; my $current_fh = &refresh_filehandle($current_date); # At each log event while (my $msg=<$in>) { $now=time(); if ( ( $now - $midnight ) > ( 24*60*60 - DST_THESHOLD ) ) { # time_to_change_files does the localtime($time) work if ( &time_to_change_files($current_date) ) { ($midnight,$current_date)=&reset_midnight(); $current_fh=&refresh_filehandle($current_date); } &log_msg($current_fh,$msg); } sub reset_midnight { my $now=time(); my ($sec, $min, $hour, @slurp_time) = localtime($now); $current_date = some_calculation_based_off_slurp_time; my $midnight = $now - ( $hour*60*60 + $min*60 + $sec ); } Fergal Daly wrote: > sub tomorrow > { > # figures out when tomorrow starts in terms of seconds from epoch so > # that it can be compared directly with a value given by time() > > my ($sec, $min, $hour) = localtime(time()); > my $tomorrow = $now - (($hour*60) * 60 + $sec) + 24*60*60; > > return $tomorrow; > } Small pedantic point: It does seem that this sub could run into a few DST issues, particularly assuming that it is used to set $tomorrow early each day (assuming a relatively busy log file (1 msg/minute?). Either way, in Spring for instance, $tomorrow would represent 1am the next day, and 11pm the same day in Autumn. And no, I haven't been stung by these issues a hundred times...honest. > A more efficient solution (the most efficient?) would be to use eval{} and > alarm() to set a timer to go off when tomorrow arrives but that'd be > overkill and has nasty pitfalls for a very small improvement over the code > above, > > F From fergal at esatclear.ie Thu May 6 06:36:18 2004 From: fergal at esatclear.ie (Fergal Daly) Date: Mon Aug 2 21:29:58 2004 Subject: [Dub-pm] Time::Piece && while loops In-Reply-To: <409A1930.F5DDC365@eircom.net> References: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com> <20040505222049.GA25280@dyn.fergaldaly.com> <409A1930.F5DDC365@eircom.net> Message-ID: <20040506113618.GD26380@dyn.fergaldaly.com> On Thu, May 06, 2004 at 11:53:36AM +0100, Gary Cosgrave wrote: > Small pedantic point: > > It does seem that this sub could run into a few DST issues, particularly > assuming that it is used to set $tomorrow early each day (assuming a relatively > busy log file (1 msg/minute?). Either way, in Spring for instance, $tomorrow > would represent 1am the next day, and 11pm the same day in Autumn. > > And no, I haven't been stung by these issues a hundred times...honest. Yeah, this stuff is a pain, I did stuff with Radius logs before where you get an start and a stop message, the stop message can arrive days after the start but for maximum usefulness it should accessible along with the start one. In that situation you should probably just forget about files and start lashing things into a proper database, F From andrew at mosina.com.au Fri May 7 06:13:52 2004 From: andrew at mosina.com.au (Andrew Barnes) Date: Mon Aug 2 21:29:58 2004 Subject: SUMMARY --> [Dub-pm] Time::Piece && while loops In-Reply-To: <20040506113618.GD26380@dyn.fergaldaly.com> References: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com><20040505222049.GA25280@dyn.fergaldaly.com><409A1930.F5DDC365@eircom.net> <20040506113618.GD26380@dyn.fergaldaly.com> Message-ID: <37442.194.69.198.40.1083928432.squirrel@webmail.ramsesit.com> Hi, Thanks to everyone who replied! In the end, I went with Time::Piece/Time::Seconds - was quite easy from there. At the end of my while loop, I run something along the lines of: my $newDate = localtime; #-# Get new current time/date if ( $newDate->ymd > $currentDate->ymd ) { &handleHUP; #-# Rotate the log our $currentDate = $newDate; } Thanks to my new-found knowledge of signals - I already had the code written to rotate off the log file :-) The real test will be when I try and change the date - but apart from that - seems to be going well Again - thanks! Andrew -- Andrew Barnes Computer Systems Consultant Mobile: 087 3803633 | Intl Mobile: +353 87 3803633 Email: andrew@mosina.com.au Web: http://www.andrew.mosina.com.au PGP Fingerprint: 2C8E E948 C62D 8C2C 48E3 0925 6ED3 78AA 5B17 6E26 From abarnes+dublin-pm at mosina.com.au Fri May 7 07:29:35 2004 From: abarnes+dublin-pm at mosina.com.au (Andrew Barnes) Date: Mon Aug 2 21:29:58 2004 Subject: SUMMARY --> [Dub-pm] Time::Piece && while loops In-Reply-To: <37442.194.69.198.40.1083928432.squirrel@webmail.ramsesit.com> References: <3156.82.141.207.123.1083790291.squirrel@webmail.ramsesit.com><20040505222049.GA25280@dyn.fergaldaly.com><409A1930.F5DDC365@eircom.net><20040506113618.GD26380@dyn.fergaldaly.com> <37442.194.69.198.40.1083928432.squirrel@webmail.ramsesit.com> Message-ID: <58875.194.69.198.40.1083932975.squirrel@webmail.ramsesit.com> Oops - damn Murphy and his law... > if ( $newDate->ymd > $currentDate->ymd ) { That should have been: if ( $newDate->ymd("") > $currentDate->ymd("") ) { From abarnes+dublin-pm at mosina.com.au Fri May 7 10:15:47 2004 From: abarnes+dublin-pm at mosina.com.au (Andrew Barnes) Date: Mon Aug 2 21:29:58 2004 Subject: [Dub-pm] problem with executable after using perlcc Message-ID: <44808.194.69.198.40.1083942947.squirrel@webmail.ramsesit.com> Hi Guys, Another question for you - I've compilied my perl sciprt on Solaris 8 - perl v5.8.3, gcc v3.2.2, make v3.8.0 The perl script on it's own runs fine. But if I try to run the compiled binary, I get the following: Modification of a read-only value attempted at countConnections.pl line 42 Any hints would be appreciated. Regards, Andrew -- Andrew Barnes Computer Systems Consultant Mobile: 087 3803633 | Intl Mobile: +353 87 3803633 Email: andrew@mosina.com.au Web: http://www.andrew.mosina.com.au PGP Fingerprint: 2C8E E948 C62D 8C2C 48E3 0925 6ED3 78AA 5B17 6E26 From abarnes+dublin-pm at mosina.com.au Tue May 11 06:37:27 2004 From: abarnes+dublin-pm at mosina.com.au (Andrew Barnes) Date: Mon Aug 2 21:29:58 2004 Subject: Summary: Re. [Dub-pm] problem with executable after using perlcc In-Reply-To: <44808.194.69.198.40.1083942947.squirrel@webmail.ramsesit.com> References: <44808.194.69.198.40.1083942947.squirrel@webmail.ramsesit.com> Message-ID: <47813.194.69.198.40.1084275447.squirrel@webmail.ramsesit.com> Hi All, Just an update on the below. I've given up on using perlcc - and installed PAR - works no problems :-) Regards, Andrew > Hi Guys, > > Another question for you - I've compilied my perl sciprt on Solaris 8 - > perl v5.8.3, gcc v3.2.2, make v3.8.0 > > The perl script on it's own runs fine. But if I try to run the compiled > binary, I get the following: > > Modification of a read-only value attempted at countConnections.pl line 42 > > Any hints would be appreciated. > > Regards, > Andrew -- Andrew Barnes Dublin Perl Mongers W: http://dublin.pm.org M: andrewbarnes@ramsesit.com M: +353873803633 PGP Fingerprint: 2C8E E948 C62D 8C2C 48E3 0925 6ED3 78AA 5B17 6E26 -- Andrew Barnes Dublin Perl Mongers W: http://dublin.pm.org M: andrewbarnes@ramsesit.com M: +353873803633 PGP Fingerprint: 2C8E E948 C62D 8C2C 48E3 0925 6ED3 78AA 5B17 6E26 From nick at netability.ie Tue May 11 06:55:54 2004 From: nick at netability.ie (Nick Hilliard) Date: Mon Aug 2 21:29:58 2004 Subject: Summary: Re. [Dub-pm] problem with executable after using perlcc In-Reply-To: <47813.194.69.198.40.1084275447.squirrel@webmail.ramsesit.com> References: <44808.194.69.198.40.1083942947.squirrel@webmail.ramsesit.com> <47813.194.69.198.40.1084275447.squirrel@webmail.ramsesit.com> Message-ID: <1084276553.20322.70.camel@pancake.netability.ie> > Just an update on the below. > > I've given up on using perlcc A lot of people tend to. While it works in many situations, it still has lots of weird quirks which can cause all sorts of problems. Nick From russell at futureless.org Tue May 11 09:29:59 2004 From: russell at futureless.org (Russell Matbouli) Date: Mon Aug 2 21:29:58 2004 Subject: [Dub-pm] Coding Standards Documentation In-Reply-To: <20040504114531.GA18006@carbon.redbrick.dcu.ie> References: <20040504114531.GA18006@carbon.redbrick.dcu.ie> Message-ID: <20040511142959.GA22755@futureless.org> Hi Dave, On Tue, May 04, 2004 at 12:45:31PM +0100, Dave O Connor wrote: > I write fairly consistent perl, but I'm wondering if anyone has come > across a good standard coding practice document, geared toward perl? I'm > talking everything from using strict, down to variable naming and bracketing > standards. Not sure if this is any use to you: http://www.bbc.co.uk/guidelines/webdev/AppA.Perl_Coding_Standards.htm (Just found that the list had started up again, Mail::Audit::List had put the messages in a folder that I hadn't noticed before.) Cheers, -- Russell Matbouli | Your face does bend even the most anorexic mirror russell@futureless.org | into a sensuous playground of muscular spasms PGP KeyID: 0x3CA84CF4 | -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.pm.org/pipermail/dublin-pm/attachments/20040511/fe1471e2/attachment.bin From Fintan.Ryan at Sun.COM Wed May 12 08:01:14 2004 From: Fintan.Ryan at Sun.COM (Fintan Ryan) Date: Mon Aug 2 21:29:58 2004 Subject: [Dub-pm] ? members... Message-ID: <40A2201A.5050105@sun.com> Afternoon, Just signed up to this this week, so how many people do we have on the list? From where etc? Curious to see who else is interested enough in Perl to join up. - F. -- Fintan Ryan fintanr@sun.com Performance Group http://perfwww.ireland http://wwws.sun.com/software/solaris/10 From doc at redbrick.dcu.ie Wed May 12 09:05:56 2004 From: doc at redbrick.dcu.ie (Dave O Connor) Date: Mon Aug 2 21:29:58 2004 Subject: [Dub-pm] ? members... In-Reply-To: <40A2201A.5050105@sun.com> References: <40A2201A.5050105@sun.com> Message-ID: <20040512140556.GB2355@carbon.redbrick.dcu.ie> Fintan Ryan said on Wed, May 12, 2004 at 02:01:14PM +0100: > Just signed up to this this week, so how many people do we have on the > list? From where etc? Curious to see who else is interested enough in > Perl to join up. > Hi, Fintan, welcome to the list. At the moment, we've 44 digested and 5 non-digested members, which I think is a pretty good number so far. I'm guessing mostly from ireland, but I think we've a few expats and hanger-onners on, too :) Week after next, I'll finally be not too busy, or too on holiday to do stuff, expect me to try dragging some sorry lurker asses to a pub somewhere in Dublin. - DoC From doc at redbrick.dcu.ie Sat May 22 21:32:58 2004 From: doc at redbrick.dcu.ie (Dave O Connor) Date: Mon Aug 2 21:29:58 2004 Subject: [Dub-pm] [wwalker@bybent.com: [pm_groups] Probable downtime...] Message-ID: <20040523023258.GA26657@carbon.redbrick.dcu.ie> Apologies for this, folks. The mailing list will be gone for the duration of whatever happens to happen. I was planning on organising a social event this week. This is either going to be postponed, or will happen if enough people mail me with a pub preference (I'm thinking Messrs., the long stone, or Mahaffey's). Again, apologies. I'm saving the subscriber list in case everything falls into the sea, and I'll let you know when stuff's back to normal. - DoC ----- Forwarded message from Wayne Walker ----- From: Wayne Walker To: pm_groups@pm.org Date: Sat, 22 May 2004 21:06:31 -0500 Subject: [pm_groups] Probable downtime... It appears that www.pm.org has been hacked. It may be down for some time for OS reinstall and restore, etc. Sorry for the short notice. The machine is hosted by RackSpace.com and I've opened a ticket to discuss a fresh OS install. There will probably be no further warning before sessation of service. I am beginning a backup to my personal server now which is well connected so the restore can happen rather quickly. -- Wayne Walker wwalker@bybent.com Do you use Linux?! http://www.bybent.com Get Counted! http://counter.li.org/ Perl - http://www.perl.org/ Perl User Groups - http://www.pm.org/ Jabber IM: wwalker@jabber.phototropia.org AIM: lwwalkerbybent _______________________________________________ pm_groups mailing list pm_groups@pm.org http://www.pm.org/mailman/listinfo/pm_groups ----- End forwarded message ----- From doc at redbrick.dcu.ie Sat May 29 18:06:05 2004 From: doc at redbrick.dcu.ie (Dave O Connor) Date: Mon Aug 2 21:29:58 2004 Subject: [Dub-pm] Update, Faraway conferences, and drinking. Message-ID: <20040529230605.GA2602@carbon.redbrick.dcu.ie> Hi, The mailing list appears to be back in order, as evidenced by your recieving this mail, and me recieving a nice batch of spam moderation requests :). So, were' back in business. I've been asked to let folks know about the upcoming YAPC::NA::2004 conference in Buffalo, New York from June 16-18, 2004. More info at http://www.yapc.org/America. This is organised by our fellow Perl Monger group in Buffalo (http://buffalo.pm.org/). Also, the Call for papers for the first Open Source Developers Conference (OSDC) in Melbourne, Australia, is coming up. See http://www.osdc.com.au/ if you happen to know you'll be in Melbourne at the start of December (I know, I'm scraping here, but I know we have some expats on the list :)). This is being run by the Melbourne Perl Mongers. On a final note, I'm hoping to hold the first 'social meeting' of Dublin.pm next thursday, 3rd June at 7pm in Messrs. on the quays. If you're interested in heading along, drop me a mail, or head on into #dublin-pm on irc.linux.ie and try to poke me, or someone else into replying. Speaking of which, feel free to drop into the IRC channel with any quick questions, or just to chat. It's been quiet of late, and getting the channel active would be just super. That's all for now. Later, folks. - DoC