[25796] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8035 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 1 06:05:18 2005

Date: Sun, 1 May 2005 03:05:05 -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           Sun, 1 May 2005     Volume: 10 Number: 8035

Today's topics:
    Re: Can this be rewritten better? <hackeras@gmail.com>
        Date::Calc::Add_Delta_YM() undefined develop@gistenson.com
    Re: Date::Calc::Add_Delta_YM() undefined <pilkowsk@informatik.uni-marburg.de>
    Re: missing the boat <mdetomaso@bak.rr.com>
    Re: missing the boat <mdetomaso@bak.rr.com>
    Re: missing the boat <pilkowsk@informatik.uni-marburg.de>
        REMOTE_HOST aint working <hackeras@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 01 May 2005 11:38:14 +0300
From: Nikos <hackeras@gmail.com>
Subject: Re: Can this be rewritten better?
Message-Id: <d524hk$dko$1@nic.grnet.gr>

Tintin wrote:
> "Nikos" <hackeras@gmail.com> wrote in message 

>>I wrote it like this to avoid getting hackers pass cgi parameters to open 
>>files from the adress bar like:
>>
>>http://www.nikolas.tk/cgi-bin/index.pl?select='../../somepath/somefile') 
>>:-)
> 
> 
> So obviously you don't mind things like:
> 
> http://www.nikolas.tk/cgi-bin/index.pl?select=/etc/passwd 

Actually no because i am not on a linux distro at the moment, iam on xp, 
so that wont work ;-)

If you type this i would care: 
http://www.nikolas.tk/cgi-bin/index.pl?select=c:\sos.txt

i would mind! I delibeately put a sos.txt file there to see if i can 
open it that way, but thankfully firefox failed to open it :-)

In conclusion i do care for thigns liek tha t, because if i didnt i 
wouldnt be writing the if statement to check for things like this.


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

Date: Sun, 1 May 2005 03:04:58 +0000 (UTC)
From: develop@gistenson.com
Subject: Date::Calc::Add_Delta_YM() undefined
Message-Id: <d51h0q$i53$1@new7.xnet.com>

Hi,

I'm using the Date::Calc module and its subroutine Add_Delta_YM(), but the 
PERL debugger is telling me that Add_Delta_YM() is an undefined 
subroutine. I have version 4.3 of the module.

In its discussion of Add_Delta_YM() versus Add_Delta_YMD(), the 
documentation at:
http://cpan.uwinnipeg.ca/htdocs/Date-Calc/Date/Calc.html
says that Add_Delta_YM() is a new subroutine.
Is the version of the module installed on my Unix box, version 4.3, the 
latest version, or is it older than the documentation I found on the web?

I'm having no problem with several other subroutines from the module. For 
example, I did:
($y, $m, $d) = Add_Delta_Days (2005, 5, 2, 3);
was successful - it resulted in the correct values for $y, $m and $d.

Here's what I'm doing:

(I ran the PERL debugger:)
/usr/local/bin/perl -de 0

(Then:)
use Date::Calc qw(:all);
$v = Date::Calc::Version();
print $v;
(The above printed: 4.3)

(Next, I wanted to add one month to May 10, 2005:)
($y, $m, $d) = Add_Delta_YM (2005, 5, 10, 0, 1);

(The resulting debugger message was that the subroutine was undefined:)
(Partial screen shot leaving in the PERL debugger prompts:)
$<2>  DB<5> $<2>($y, $m, $d) = Add_Delta_YM (2005, 5, 10, 0, 1);
Undefined subroutine &main::Add_Delta_YM called at (eval 6) line 2.
        eval '($@, $!, $^E, $,, $/, $\\, $^W) = @saved;package main; $^D = 
$^D |
 $DB::db_stop;
($y, $m, $d) = Add_Delta_YM (2005, 5, 10, 0, 1);;

;' called at /usr/local/lib/perl5/5.00503/perl5db.pl line 1239
        DB::eval called at /usr/local/lib/perl5/5.00503/perl5db.pl line 
1133
        DB::DB called at -e line 1

$<2>  DB<6> $<2>                                                               
(End of screen shot.)

Thanks,
Dan



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

Date: Sun, 1 May 2005 10:42:46 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: Date::Calc::Add_Delta_YM() undefined
Message-Id: <3djj3bF6qtcf6U1@individual.net>

* develop@gistenson.com schrieb:
> 
> I'm using the Date::Calc module and its subroutine Add_Delta_YM(), but the 
> PERL debugger is telling me that Add_Delta_YM() is an undefined 
> subroutine. I have version 4.3 of the module.
> 
> In its discussion of Add_Delta_YM() versus Add_Delta_YMD(), the 
> documentation at:
> http://cpan.uwinnipeg.ca/htdocs/Date-Calc/Date/Calc.html
> says that Add_Delta_YM() is a new subroutine.

> Is the version of the module installed on my Unix box, version 4.3, the 
> latest version, or is it older than the documentation I found on the web?

You answers your question by yourself. Yes, you've a version problem.
Try to install a new version from CPAN, currently 5.4.

    http://search.cpan.org/~stbey/Date-Calc-5.4/

regards,
fabian


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

Date: Sun, 01 May 2005 07:16:51 GMT
From: "Michael De Tomaso" <mdetomaso@bak.rr.com>
Subject: Re: missing the boat
Message-Id: <Dn%ce.8112$Au1.1311@tornado.socal.rr.com>


"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message 
news:Xns9648A4DD39B48asu1cornelledu@127.0.0.1...
> "Michael De Tomaso" <mdetomaso@bak.rr.com> wrote in news:9zPce.15457
> $R46.3867@tornado.socal.rr.com:
>
>>
>> Q: given a text file: "arp.txt" as follows:
> ...
>> D:\study\perl\WIP>type arp.txt
>>
>> Interface: 192.168.1.100 --- 0x2
>>   Internet Address      Physical Address      Type
>>
>>   192.168.1.107         00-01-02-7c-94-47     dynamic
>>   192.168.1.109         00-50-ba-a2-90-86     dynamic
>
> ...
>
>> #!perl -w
>>
>> print "where is mdtFRIENDS:\n";
>> print `grep "00\-50\-ba\-a2\-90\-86" arp.txt`;
>>
>> print "test over\n";
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>
>> Q: why don't get the line with the mac address on the screen?
>
> I don't know. It works on my system, although I do not see the point of
> the exercise. If you are just going to use perl to spawn grep, why not
> just grep in the first place?
>
>> D:\study\perl\WIP>grep "00\-50\-ba\-a2\-90\-86" arp.txt
>>   192.168.1.109         00-50-ba-a2-90-86     dynamic
>
> Good for you.
>
>> Q: where am I missing the boat???
>
> By mispelling the word tomato, doing it in a particularly gaudy way, and
> not using a proper sig separator so my newsreader can automatically snip
> the stupid eyesore.
>
> -- 
> A. Sinan Unur <1usa@llenroc.ude.invalid>
> (reverse each component and remove .invalid for email address)
>
> comp.lang.perl.misc guidelines on the WWW:
> http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


Unur A

>>point of the exercise

Wanted to begin making small tools to assist me in the SOHO.  This baby step 
was to ping a range of IP's, use the arp -a to get at the mac address, to 
match them against a set of known values, to display a mini map of where at 
a given point in time certain machines are, and what their current IP is, so 
that I can attach to them, using various remote methods, as I dislike 
walking over to them, turn their monitor on so that I can visually inspect 
their IP, etc.

 ... meanwhile, the more I see and hear of Perl, the louder it becomes that 
their are TMTOWTDI 2 infinity & beyond.

http://www.e-commerce-consortium.com/blog/archives/Nokia(845)_444x592.jpg

           (.) (.)          (.) (.)
-- You say tomato and I say tomatoe, Let's call the whole thing off
  _                                _
 | |_   ___    _ __ ___     __ _  | |_   ___     ___
 | __| / _ \  | '_ ` _ \   / _` | | __| / _ \   / _ \
 | |_ | (_) | | | | | | | | (_| | | |_ | (_) | |  __/
  \__| \___/  |_| |_| |_|  \__,_|  \__| \___/   \___|





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

Date: Sun, 01 May 2005 07:22:50 GMT
From: "Michael De Tomaso" <mdetomaso@bak.rr.com>
Subject: Re: missing the boat
Message-Id: <et%ce.8114$Au1.248@tornado.socal.rr.com>


"Tad McClellan" <tadmc@augustmail.com> wrote in message 
news:slrnd789rh.kcm.tadmc@magna.augustmail.com...
> Michael De Tomaso <mdetomaso@bak.rr.com> wrote:
>
>> print `grep "00\-50\-ba\-a2\-90\-86" arp.txt`;
>
>
> Hyphens are not special in regexes, there is no need to backslash them.
>
>
>> Q: where am I missing the boat???
>
>
> By "shelling out" to do something that is easily done in native Perl.
>
>
>
> [ snip onerous .sig ]
>
> -- 
>    Tad McClellan                          SGML consulting
>    tadmc@augustmail.com                   Perl programming
>    Fort Worth, Texas

Tad,

>> Hyphens are not special in regexes,

 ... so much to learn, so little time, http://perl.plover.com/Regex/ but hey 
51 is 9 better than 42 :)

>> By "shelling out" to do something that is easily done in native Perl.

I'll learn, I'll learn, just give me a nano-second.

Q: Meanwhile, I really do have to get a Better News Reader, what R U folks 
using ???

Thanks & take care M.D.





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

Date: Sun, 1 May 2005 10:34:56 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: missing the boat
Message-Id: <3djikmF6r148tU1@individual.net>

[ Please learn how to quote. It is more than annoying to read a
  fullquote first, and read the specified parts you are answering
  to again. Try to miss out the fullquote, thanks. ]

* Michael De Tomaso schrieb:
> 
> I'll learn, I'll learn, just give me a nano-second.
> 
> Q: Meanwhile, I really do have to get a Better News Reader, what R U folks 
> using ???

The header of almost each posting contains a entry named "User-Agent".
Ok, your MS Outlook Express names this "X-Newsreader", unfortunately.
Have a look at that to find out which newsreader ons's using -- there's
no need to ask for.

regards,
fabian


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

Date: Sun, 01 May 2005 12:59:42 +0300
From: Nikos <hackeras@gmail.com>
Subject: REMOTE_HOST aint working
Message-Id: <d529ab$hj6$1@nic.grnet.gr>

my $host = $ENV{'REMOTE_HOST'} || $ENV{'REMOTE_ADDR'};

Why the above line of code always returns the ip address and never the 
hostname of the visitor of my indx.pl cgi script?


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

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 V10 Issue 8035
***************************************


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