[17399] in Perl-Users-Digest
Perl-Users Digest, Issue: 4819 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 6 06:05:45 2000
Date: Mon, 6 Nov 2000 03:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <973508708-v9-i4819@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 6 Nov 2000 Volume: 9 Number: 4819
Today's topics:
atoi for Perl, again <ddijk@hetnet.nl>
Re: atoi for Perl, again (Logan Shaw)
Re: atoi for Perl, again (Martien Verbruggen)
Re: atoi for Perl <gellyfish@gellyfish.com>
Re: how to make $ARGV[0] numeric <gellyfish@gellyfish.com>
Re: how to sort corresponding arrays? (Logan Shaw)
Re: i'm new. will someone direct me? <rpark4@email.msn.com>
Re: Looking for idiom for getting value from @ARGV, or <uri@sysarch.com>
Re: Looking for idiom for getting value from @ARGV, or <uri@sysarch.com>
Re: Looking for idiom for getting value from @ARGV, or (Martien Verbruggen)
Re: Newbie question: Get date of 3rd Friday in a given <sb@muccpu1.muc.sdm.de>
Re: Passing hash to perl module spcman@my-deja.com
Re: Passing hash to perl module (Eric Bohlman)
Re: Passing hash to perl module <bwlang@usa.net>
Re: Perl CGI won't fork with mod_perl in Apache <gellyfish@gellyfish.com>
Re: Perl flock function problem in BSDI 3.0 & 4.0 (Martien Verbruggen)
Re: Splitting variable length fixed records <ianb@ot.com.au>
Thanks doing more reading <markscott@barclays.net>
Thanks doing more reading <markscott@barclays.net>
Re: Using file with procedures <bwlang@usa.net>
Re: values of strings <daniel.hendrickx@alcatel.be>
Where does a core dump come from? <usequity@mindspring.com>
Re: Where does a core dump come from? (Logan Shaw)
Re: Where does a core dump come from? (Logan Shaw)
Where to find IO/Pty.pm? <uackermann@orga.com>
Re: why can the browser do it but my perl prog. cannot (Rafael Garcia-Suarez)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 6 Nov 2000 08:24:19 +0100
From: "dick dijk" <ddijk@hetnet.nl>
Subject: atoi for Perl, again
Message-Id: <uXRzzM8RAHA.85@net025s>
Ok, maybe I wasn't clear yesterday, but here is my little program that
doesn't work:
It is called "testhex", and you have to specify a hex argument on the
commandline, like this:
>testhex e2
The program looks like this:
$a = $ARGV[0];
$b = pack("n", $a);
Somehow this doesn't work (error: "argument isn't numeric in pack"). It does
work if you specify a decimal argument (like "testhex 4").
Does anyone know how to make it work for a hex argument?
Dick
------------------------------
Date: 6 Nov 2000 02:17:07 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: atoi for Perl, again
Message-Id: <8u5pe3$fs$1@provolone.cs.utexas.edu>
In article <uXRzzM8RAHA.85@net025s>, dick dijk <ddijk@hetnet.nl> wrote:
>The program looks like this:
>
>$a = $ARGV[0];
>
>$b = pack("n", $a);
:
:
>Does anyone know how to make it work for a hex argument?
Use oct():
#! /usr/local/bin/perl
$a = oct ("0x$ARGV[0]");
print "\$a is $a.\n";
"perldoc -f oct" for more info.
Hope that helps.
- Logan
------------------------------
Date: Mon, 6 Nov 2000 21:25:56 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: atoi for Perl, again
Message-Id: <slrn90d1pk.567.mgjv@martien.heliotrope.home>
On 6 Nov 2000 02:17:07 -0600,
Logan Shaw <logan@cs.utexas.edu> wrote:
> In article <uXRzzM8RAHA.85@net025s>, dick dijk <ddijk@hetnet.nl> wrote:
>>The program looks like this:
>>
>>$a = $ARGV[0];
>>
>>$b = pack("n", $a);
> :
> :
>>Does anyone know how to make it work for a hex argument?
>
> Use oct():
>
> #! /usr/local/bin/perl
>
> $a = oct ("0x$ARGV[0]");
>
> print "\$a is $a.\n";
>
> "perldoc -f oct" for more info.
# perl -wle '$_ = oct("0x$ARGV[0]")' k
Illegal hexadecimal digit 'k' ignored at -e line 1.
You'll need to put some regex or so before it to make sure it's a legal
hex number. Or use eval.
Martien
--
Martien Verbruggen |
Interactive Media Division | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd. | you come to the end; then stop.
NSW, Australia |
------------------------------
Date: 5 Nov 2000 20:32:19 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: atoi for Perl
Message-Id: <8u4g4j$f1h$1@orpheus.gellyfish.com>
On Sun, 5 Nov 2000 19:33:04 +0100 dick dijk wrote:
> Hello,
>
> Does anyone know the "atoi()" function (from C) equivalent in Perl?
>
You dont need one in Perl, if a string looks like a number you can treat it
like a number.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 5 Nov 2000 20:33:15 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how to make $ARGV[0] numeric
Message-Id: <8u4g6b$f1k$1@orpheus.gellyfish.com>
On Sun, 5 Nov 2000 15:29:52 +0100 dick dijk wrote:
> Hello,
>
> Does anyone know how to make a commandline argument (like $ARGV[0]) numeric,
> so that you can use it in
> "$a = pack("n", $ARGV[0])"?
If it is a number it is a number.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 5 Nov 2000 23:43:16 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: how to sort corresponding arrays?
Message-Id: <8u5gdk$sh1$1@provolone.cs.utexas.edu>
Keywords: browse, forbid, gasify, practicable
In article <v9qN5.193$Bf7.170932224@news.frii.net>,
Chris Fedde <cfedde@fedde.littleton.co.us> wrote:
>In article <3a04a234.5467$135@news.op.net>,
>Mark-Jason Dominus <mjd@plover.com> wrote:
>>
>>See
>>
>> http://perl.plover.com/yak/hw2/slide003.html
>>
>
>404
As long as we're answering cryptically:
$ wget --quiet --output-document=- \
http://perl.plover.com/yak/hw2/slide003.html |
grep -c TITLE
1
$
Hope that helps.
- Logan
------------------------------
Date: Sun, 5 Nov 2000 22:52:31 -0800
From: "rpark4" <rpark4@email.msn.com>
Subject: Re: i'm new. will someone direct me?
Message-Id: <#JpNq77RAHA.327@cpmsnbbsa09>
boy i sure am sorry that i forgot to mention that i have already been
programming in C++. i don't remember saying that i considered HTML/CSS
programming. because i don't. since it's not.
thanks for the help anyway. i'll get the llama book.
------------------------------
Date: Mon, 06 Nov 2000 05:49:33 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Looking for idiom for getting value from @ARGV, or a default
Message-Id: <x7g0l5hcpe.fsf@home.sysarch.com>
>>>>> "MV" == Martien Verbruggen <mgjv@tradingpost.com.au> writes:
MV> If you really need to test for defined-ness, then you need to use two
MV> statements:
MV> $s = shift @ARGV;
MV> $s = 'default' unless defined $s;
$s = defined( $ARGV[0] ) ? shift : 'default' ;
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Mon, 06 Nov 2000 06:49:12 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Looking for idiom for getting value from @ARGV, or a default
Message-Id: <x7d7g9h9xy.fsf@home.sysarch.com>
>>>>> "AD" == Ameen Dausha <ameen> writes:
AD> $s = shift @ARGV if (@ARGV) || $s = 'default';
AD> Not that I'm an expert in this.
please test code than and you will know if it is good. a classic trap
which caught you is that || binds tighter than =.
that trap is escaped by using parens or 'or'.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Mon, 6 Nov 2000 20:52:58 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Looking for idiom for getting value from @ARGV, or a default
Message-Id: <slrn90cvrq.567.mgjv@martien.heliotrope.home>
On Mon, 06 Nov 2000 05:49:33 GMT,
Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "MV" == Martien Verbruggen <mgjv@tradingpost.com.au> writes:
>
>
> MV> If you really need to test for defined-ness, then you need to use two
> MV> statements:
>
> MV> $s = shift @ARGV;
> MV> $s = 'default' unless defined $s;
>
> $s = defined( $ARGV[0] ) ? shift : 'default' ;
Yeah, Jeff Pinyan also posted this. I've never used this, which is why I
didn't think of it. I probably never will use it either. Having short
code is nice, but I find that just a teensie bit too unreadable. It
needs a double take to extract the meaning :)
Martien
--
Martien Verbruggen |
Interactive Media Division | I'm just very selective about what I
Commercial Dynamics Pty. Ltd. | accept as reality - Calvin
NSW, Australia |
------------------------------
Date: 6 Nov 2000 10:45:07 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: Re: Newbie question: Get date of 3rd Friday in a given year/month?
Message-Id: <8u623j$lbu$1@solti3.sdm.de>
In article <VrgN5.20261$%j.6372783@typhoon.southeast.rr.com>, David Sisk <davesisk@ipass.net> wrote:
> Any ideas on how to easily do this in a CGI script? Please post or email?
> Best regards,
> Dave
use Date::Calc qw(:all);
($year,$month,$day) = Today();
($year,$mm,$dd) = Nth_Weekday_of_Month_Year($year,$month,5,3);
# 5 = Friday
# 3 = 3rd
Regards,
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/ (Who am I)
http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)
------------------------------
Date: Mon, 06 Nov 2000 05:01:29 GMT
From: spcman@my-deja.com
Subject: Re: Passing hash to perl module
Message-Id: <8u5dv7$fi9$1@nnrp1.deja.com>
Ok heres my source code. Its not working. Look at the code then look
at the output at the bottom. What im trying to do is pass the %INFO
hash from test.cgi over to template.pm. When I try to receive the hash
in template.pm, i receive different values.
################## Code for Test.cgi #######################
#!/usr/local/bin/perl
use template;
$Location = "test.template";
$INFO{'name'} = "Joe Schmoe";
$INFO{'address'} = "123 Lucky Lane";
$INFO{'city'} = "Anytown";
$INFO{'state'} = "XY";
$INFO{'zip'} = "12345";
print "Content-Type: text/html\n\n";
$RunTemplate = New template;
$RunTemplate -> SetVariables(\%INFO);
################# Code for Template.pm ######################
package template;
sub New {
my $class = shift; #Not sure what this code
my %baseHtml = (); #Does yet, havent reverse
bless \%baseHtml, $class; #Enginereed it.
return \%baseHtml
}
sub SetVariables {
my(%hash) = @_;
foreach $key (keys %hash) {
print "$key value: $hash{$key}<BR><BR>"; #Look at output below
}
}
1;
#########OUTPUT##########
template=HASH(0x80cb024) value: HASH(0x80bbec4)
#########OUTPUT##########
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 6 Nov 2000 05:49:32 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Passing hash to perl module
Message-Id: <8u5gpc$2ajc$1@news.enteract.com>
spcman@my-deja.com wrote:
> How to I send the hash to template.pm and how do
> i receive the hash in template.pm
> Heres my current code in test.cgi...
> $RunTemplate = New template;
> $RunTemplate -> SetVariables(%MyHash);
That's just fine. The keys and values of %MyHash will be "unrolled" into
a list and passed as arguments.
> $RunTemplate -> ProcessTemplate($Location);
> heres my code in template.pm
> sub SetVariables {
> my %hash = @_;
That's *almost* right. What you've forgotten is that when you call a
method, the object itself (in this case $RunTemplate) is automatically
passed as the first argument. If you'd turned on warnings, you'd have
gotten one about assigning an odd number of elements to a hash. You need
to shift off the first argument before doing the assignment.
> }
------------------------------
Date: Mon, 06 Nov 2000 08:25:21 GMT
From: bwlang <bwlang@usa.net>
Subject: Re: Passing hash to perl module
Message-Id: <3A066AF1.9CB9CA72@usa.net>
pass a reference
spcman@my-deja.com wrote:
>
> Heres my current code in test.cgi...
>
> $RunTemplate = New template;
> $RunTemplate -> SetVariables(%MyHash);
$RunTemplate->SetVariables(\%MyHash);
>
> $RunTemplate -> ProcessTemplate($Location);
>
> heres my code in template.pm
>
> sub SetVariables {
> my %hash = @_;
my $rh_hash = @_;
#then access stuff in it like this
$value = $$rh_hash{'key'}
or loop like this
foreach (keys %$rh_hash) {
print;
}
>
> }
>
> I know its not right but assuming i want to pass
> a hash to the subroutine SetVariables in the
> Template.pm perl module... can someone please
> write me some code. Thanks - Al
>
------------------------------
Date: 6 Nov 2000 07:17:41 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl CGI won't fork with mod_perl in Apache
Message-Id: <8u5lul$goe$1@orpheus.gellyfish.com>
On 05 Nov 2000 07:32:15 GMT Draxus wrote:
> I'm running Apache 1.3.12 on a server running Redhat Linux 7.0. For
> some reason Apache won't allow a Perl CGI that I am running to fork.
>
> I have updated all of the Apache Perl modules using CPAN.pm.
>
> I can run the script stand-alone as any user (including as user
> "nobody") and it deletes the output file fine. Run it as an Apache CGI
> script and it works up until the point of where it is supposed to fork
> and then it doesn't delete the file. It doesn't come up with any
> errors is any of the apache logs. For some reason mod_perl just
> doesn't like it... Anyone have any suggestions?
>
You havent asked for any error messages to be output if 'unlink' fails :
unlink $outfile or die "Can't delete outfile - $!\n";
In general I can see no reason why mod_perl should behave different
with respect to fork().
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Mon, 6 Nov 2000 21:17:13 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Perl flock function problem in BSDI 3.0 & 4.0
Message-Id: <slrn90d199.567.mgjv@martien.heliotrope.home>
On Mon, 06 Nov 2000 15:05:19 +1100,
Willis Kwok <wkwok@uunet.com.au> wrote:
> thanks for your reply.
>
> I am doing a locking on a regular file but NFS mount file system.
Locking on NFS is unreliable on many systems. Unless your kernel
implements some special things, you shouldn't try. The flock(2) (or
fcntl(2)) man page should be able to tell you whether it's safe to lock
files over NFS. Linux flock(2) doesn't, but Solaris fcntl(2) does.
It depends what Perl uses for your system, what's available, and what's
supported.
But, your program shouldn't really hang on it. I must say, the 'hanging'
sounds a bit like a deadlock. You're sure that your program doesn't call
flock on the same open file twice, right?
> Do you know whether perl 5_003 & 5_004's made any changes to the flock ()
> function. Because i migrated my code to different version of OS & perl.
The implementation of flock in Perl has changed a few times, but AFAIK
it only got more sophisticated. I believe it tries to use fcntl(2)
wherever it can nowadays, but I don't know for sure.
> If i dont do file locking in Perl, can i leave the OS do it for me?
No. You will have to do it explicitly. What you need to do is make sure
that Perl picks the best method for your OS. Reconfigure perl (sh
Configure), and pay attention to the parts where it configures the
locking. Try a few different combinations. If I knew anything about
BSDI, I would tell you what to do, but I don't.
But, before you do any of all of the above, change the code you
presented according to my suggesitons, and see if you still have a
problem.
> The code is just as simple as below:
>
> sub readdata {
> if (open(DATA,"$datafile")) {
> flock(DATA,2);
> @$r_data = <DATA>;
> flock(DATA,8);
> close(DATA);
> }
> else {
> my_die("Error in subroutine readdata: Can't open $datafile",$!);
> }
>
> $r_data;
> }
A few things:
On many systems, you can only exclusively lock a file when you open it
with write intent, you want to use LOCK_SH, or 1. Apart from that, you
should always check return values of all system calls. I'd also prefer
it if you used predefined constants, instead of hardcoding these
numbers. It is highly unlikely that they'll ever change, but just in
case... And besides that, using the symbols instead of the numbers is
much easier, because you'll remember what they are for.
(Stylistic nit: You've got some superfluous quotes there, and
DATA is a special file handle. Probably better to avoid it, or at
least, localise it, and where did $rdata come from?)
So, to get the symbols for locking:
use Fcntl ':flock';
And your sub could look like:
sub readdata
{
my $datafile = shift;
local (*DATA);
open DATA, $datafile or die $!;
flock DATA, LOCK_SH or die $!;
my @lines = <DATA>;
close DATA;
return \@lines;
}
or slightly simpler, using the fact that a localised file handle will
automatically be closed on exit of the sub:
sub readdata
{
my $datafile = shift;
local (*DATA);
open DATA, $datafile or die $!;
flock DATA, LOCK_SH or die $!;
[<DATA>]
}
If you don't want to return a reference to an array, but just a list,
remove the square brackets. I'm just mirroring what you did. Maybe
something like:
sub readdata
{
my $datafile = shift;
local (*DATA);
open DATA, $datafile or die $!;
flock DATA, LOCK_SH or die $!;
wantarray ? <DATA> : [<DATA>];
}
is a bit more flexible. It'll return a list in list context, and an
array reference in scalar context (or void context)
Martien
--
Martien Verbruggen |
Interactive Media Division | That's not a lie, it's a
Commercial Dynamics Pty. Ltd. | terminological inexactitude.
NSW, Australia |
------------------------------
Date: Mon, 06 Nov 2000 17:35:41 +1100
From: Ian Boreham <ianb@ot.com.au>
Subject: Re: Splitting variable length fixed records
Message-Id: <3A06513C.A66E0221@ot.com.au>
Peter Sundstrom wrote:
> I have a file of fixed records of variable length (newline terminated), eg:
>
> F1F2..F120
>
> Where
>
> F1 is 120 bytes
> F2 up to F120 is 60 bytes.
>
>
This code (the marked line) does something like what you want (but note that I
have used smaller numbers for the sake of the example). It does not enforce
the maximum field count, but it does cope with short fields. If you don't want
that behaviour, change the quantifiers to {6}, {3}. Note the blank line still
counts as a very short single-field line.
Regards,
Ian
#!/usr/bin/perl -w
foreach(<DATA>)
{
$newrecord = join("\n", m/^.{0,6}|\G.{1,3}/g); # This line.
print "---\n$newrecord\n";
}
print "---\n";
__DATA__
hello_there,_how_are_you_going?
fine,_thanks,_and_yourself?
------------------------------
Date: Mon, 6 Nov 2000 05:21:46 -0000
From: "mark" <markscott@barclays.net>
Subject: Thanks doing more reading
Message-Id: <3a063e85$1@news.jakinternet.co.uk>
Jeff Zucker <jeff@vpservices.com> wrote in message
news:3A062BC5.E90CD951@vpservices.com...
> mark wrote:
>
> [snip of entire posting already sent to this newsgroup
> under a different subject heading]
>
> > (Please Read 'What am I doing wrong')
>
> Please post a question only once under one subject.
>
> --
> Jeff
------------------------------
Date: Mon, 6 Nov 2000 05:22:11 -0000
From: "mark" <markscott@barclays.net>
Subject: Thanks doing more reading
Message-Id: <3a063e9f$1@news.jakinternet.co.uk>
Peter Sundstrom <peter.sundstrom@eds.com> wrote in message
news:8u5bgu$435$1@hermes.nz.eds.com...
>
> mark <markscott@barclays.net> wrote in message
> news:3a06165e@news.jakinternet.co.uk...
> > Hi and thanks for any help in advance, mark.
> >
> > Okay ive been working really hard, alot of hours and getting nowhere,
> >
> > All I want to do is log an ip and time stamp it, send it to a file that
I
> > can look
> > at later, without a visitor knowing the ip has just been recorded.
> >
> > The Following script works on my machine (Except for the IP) but when I
> put
> > it up nothing!!
> > So I have the following files in Question.
> > 1/logip.html #this is my test page which should execute perl script
> (default
> > chmod)
> > 2/ip.pl #The perl script to send the info to ip.html (chmod 755)
> > 3/ip.html # The results? (chmod 646)
> >
> > <logip.html> looks like this.
> > ---------------------------------------------------------------
> > <html>
> > <head>
> > <title>Log IP</title>
> > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> > </head>
> > <!#exec cgi="/cgi-bin/ip.pl">
> > <body bgcolor="#000000">
> > </body>
> > </html>
> > ----------------------------------------------------------------------
> > <ip.pl>
> > #!/usr/bin/perl
> > $out="/newweb/ip.html";
> > open OUT, ">>$out" or die "Cannot open $out for write :$!";
> > print OUT ": ",scalar(localtime)," IP: ",$ENV{'REMOTE_ADDR'},"\n";
> > close OUT;
> > ----------------------------------------------------------------------
> > <ip.html>
> > "Should have time and ip information"?
> >
> > My ISP says "Yes, we support SSI, but not executable SSI scripts."
> > They support Perl
> > What can be the problem?
> >
> > If the problem is SSI then is there another solution i could use?
> > Point me in the right direction?
> > Can't thank you enough if you can get me out of this hole I'm in!!
>
> This is OT for this newsgroup. Essentially your ISP does not allow SSI
> scripts, so you will have to use another method. Why not just use the
> webserver log? It will have the IP address and time in it.
>
>
------------------------------
Date: Mon, 06 Nov 2000 08:28:54 GMT
From: bwlang <bwlang@usa.net>
Subject: Re: Using file with procedures
Message-Id: <3A066BC6.202B4284@usa.net>
I would take the non script specific functions out
of your first script and put those into a module
the have both 1st and 2nd scripts source the same module.
brad
Ildar Gabdullin wrote:
> Hello, all.
>
> I have perl script with lot of procedures.
> How I can use these procedures in other perl script without converting
> 1st script to module and using use <module_name> in second script ?
> Converting to module is not appropriate, because I want to determine
> disposition of file with procedures at runtime.
>
> Any help very appreciated.
>
> Ildar.
------------------------------
Date: Mon, 06 Nov 2000 08:52:53 +0100
From: Danny Hendrickx <daniel.hendrickx@alcatel.be>
Subject: Re: values of strings
Message-Id: <3A066355.C0F80D1F@alcatel.be>
Thanks for the info guys.
Danny Hendrickx wrote:
>
> Hello,
>
> I just split up a string in its individual characters. Now I would like
> to print the hex-value of each character of that string, (sort of like
> printf("%X",$a) in C, where $a would contain a character), but I can't
> find the perl way to do this. Can anyone help me please.
--
Regards,
________________
________________________________________________\ /_____
CTXT XPT Team Leader BP8 Team 4 (Call Handling) \ /
SW-Engineering - Routing - VJ24 Hendrickx Danny
phone : +32-3-240 3916 ALCATEL TELECOM
fax : +32-3-240 9899 Fr.Wellesplein 1
mailto:daniel.hendrickx@alcatel.be 2018 Antwerp Belgium
______________________________________________________\ /___________
URL: http://www.se.bel.alcatel.be/CH_sector1/SS31/ \/
*********************************************************************
Time flies like the wind,
fruit flies like bananas.
*********************************************************************
------------------------------
Date: Sun, 5 Nov 2000 22:56:06 -0600
From: "Henry" <usequity@mindspring.com>
Subject: Where does a core dump come from?
Message-Id: <8u5ebc$f47$1@slb7.atl.mindspring.net>
I get a core file every now and then. I know it must come from my program
somehow, but have never isolated it. I guess deleting it doesn't hurt
anything.
------------------------------
Date: 5 Nov 2000 23:50:10 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Where does a core dump come from?
Message-Id: <8u5gqi$si8$1@provolone.cs.utexas.edu>
In article <8u5ebc$f47$1@slb7.atl.mindspring.net>,
Henry <usequity@mindspring.com> wrote:
>I get a core file every now and then. I know it must come from my program
>somehow, but have never isolated it. I guess deleting it doesn't hurt
>anything.
If you're on a Unix system, it comes from the kernel.
The kernel determines somehow (through an interrupt or something) that
your process did something bad, or that something bad happened to your
process. In response, it saves an image of the process so you can
figure out what happened and fix it. In summary, Unix was TQM when TQM
wasn't cool.
- Logan
------------------------------
Date: 6 Nov 2000 02:11:14 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Where does a core dump come from?
Message-Id: <8u5p32$f7$1@provolone.cs.utexas.edu>
In article <t0cjufomhvo253@corp.supernews.com>,
Dale Emmons <dale@emmons.dontspamme.com> wrote:
>> In summary, Unix was TQM when TQM
>> wasn't cool.
>
>Just curious... what does TQM mean? Total Quality Managment?
Exactly. Unix has been dumping core since long before TQM became a
buzzword, and of course mainframes were probably doing it before Unix.
It's not exactly the same thing as TQM, but it's similar...
- Logan
------------------------------
Date: Mon, 06 Nov 2000 11:42:51 +0100
From: Ulrich Ackermann <uackermann@orga.com>
Subject: Where to find IO/Pty.pm?
Message-Id: <3A068B2B.CCEAB65E@orga.com>
Hi all,
I am trying to install the Crypt-PGP5 module (Version 1.37) I got from
CPAN. After having installed the required modules Time/HiRes.pm and
Expect.pm I there is still the IO/Pty.pm module missing. I have not
found that one on CPAN. Does anybody know where to get it?
TIA, Ulrich
--
Ulrich Ackermann
ORGA Kartensysteme GmbH (SY-PEAT-STA)
Tel.:+49.5254.991-925
mailto:uackermann@orga.com
------------------------------
Date: Mon, 06 Nov 2000 08:09:29 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: why can the browser do it but my perl prog. cannot ?
Message-Id: <slrn90cptb.43c.rgarciasuarez@rafael.kazibao.net>
jawanth & meena vytheeswaran & nagarajan wrote in comp.lang.perl.misc:
>I have a Perl program which uses LWP etc. to access web pages on a site.
>The site requires login. I login through netscape browser manually and then
>run my program with the Netscape cookies file. <hoping it as a way to pass
>my state info to server, hoiping to tell it, "hey, remember me, I am logged
>in already...">
>My object is to recursively access pages on the site (imagine a document
>tree, with a root url which lists several urls etc.). Now, I am able to
>access the last leaf url <which is just a url as far as I am concerned>.
>However, I am NOT able to "navigate" down the tree starting at a root url.
>When I access the root url, <lets call it the "starting point" of interest>
>from my Perl program, it sends back an html asking to login, etc.
>However, my Netscape browser is able to access it <once the login process is
>over>.
>
>1) I am not able to understand why i would be able to access the leaf url
>through the Perl program at all when the server does not consider me as
>logged in.
>2) Did my cookie approach not fully accomplish what I was thinking (avoiding
>writing code to do the login process, since I dont know how to do it !)?
><there must be more to it than simply copying cookies ?>
Netscape does not store session cookies (the ones that expire when the
browser is closed) in its 'cookies' file. The login process uses
probably a session cookie. You can view cookies that are sent to
netscape by enabling the "warn me before accepting a cookie" option.
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4819
**************************************