[16005] in Perl-Users-Digest
Perl-Users Digest, Issue: 3417 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 19 06:08:55 2000
Date: Mon, 19 Jun 2000 03:05:19 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <961409118-v9-i3417@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 19 Jun 2000 Volume: 9 Number: 3417
Today's topics:
Re: bug with arrays? <gellyfish@gellyfish.com>
Re: bug with arrays? (Csaba Raduly)
capturing warnings from lpstat <mike.solomon@eps.ltd.uk>
Re: Content type !! <hedim@hta-bi.bfh.xxx>
Re: Crazy enough that it might just work... (Tad McClellan)
Re: Dir Listsing <map@usnavy.gov>
Re: Does anyone have some exercises? <gellyfish@gellyfish.com>
Re: Dumb question.. How to prompt the user and get the (Joe Smith)
Re: Exporting <gellyfish@gellyfish.com>
Re: Extract filename from path? (Joe Smith)
Freestanding COM object <kdl@softhome.net>
Re: good books for beginning Perl? <gellyfish@gellyfish.com>
Re: good books for beginning Perl? <gellyfish@gellyfish.com>
Re: How to decode binhex encoded email attachments? <gellyfish@gellyfish.com>
Re: I can't figure this one out... (Newbie question) (Mark Badolato)
Re: link to a module when perl program starts <gedichte@lycosmail.com>
Mailing in PERL/CGI <etxaved@etxb.ericsson.se>
Re: Mailing in PERL/CGI <dave@dave.org.uk>
Messagebox in Win32 <Jan.vanMansum@s1.com>
Re: Messagebox in Win32 <giuffridaj@netzero.net>
Multidimensional array. <halvfem@hotmail.com>
Re: Multidimensional array. (Rafael Garcia-Suarez)
Re: Multidimensional array. <halvfem@hotmail.com>
Re: Multidimensional array. <dave@dave.org.uk>
Re: Name/Value pair for a hyperlink? <gellyfish@gellyfish.com>
Re: Need Help ! Please Read ! (Tad McClellan)
Re: Need help with timelocal <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 19 Jun 2000 08:33:43 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: bug with arrays?
Message-Id: <8ikicn$l3c$1@orpheus.gellyfish.com>
On 16 Jun 2000 20:17:53 GMT Ilmari Karonen wrote:
> In article <MPG.13b40b59c1619a5798ab8d@nntp.hpl.hp.com>, Larry Rosler wrote:
>>In article <8idn9k$38n$1@engnews3.Eng.Sun.COM> on 16 Jun 2000 17:14:28
>>GMT, Joe Petolino <petolino@Eng.Sun.COM> says...
>>>
>>> @month_name{1..12} = qw(jan feb mar apr may jun jul aug sep oct nov dec);
>>
> [sample code referencing $month_name{'06'} snipped]
>>
>>Oops. Better add 0 to that substr.
>
> ..at which point you might as well subtract 1 from it instead. Catch-22.
>
> In my opinion the fundamental misdesign causing all these problems
> is thousands of years old. If our ancestors had been less bound by
> tradition, or their ancestors more logically consistent, we'd all be
> counting ordinals from zero and there'd be no problem..
>
Perhaps but zeroeth is just so difficult to pronounce ...
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 19 Jun 2000 09:08:43 GMT
From: csaba_r@my-deja.com (Csaba Raduly)
Subject: Re: bug with arrays?
Message-Id: <8F586E7EAquuxi@193.82.145.131>
19 Jun 2000: A formal bug report was sent to Seti@Home, because the
following message originated from gellyfish@gellyfish.com (Jonathan
Stowe) was reported as containing signs of intelligence:
[snip]
>
>Perhaps but zeroeth is just so difficult to pronounce ...
>
And it's wrong, too. It should be zeroth.
Zeroeth is a verb, describing this action:
<CODE language="c">
memset( array, 0, sizeof(array) );
</CODE>
As in "He zeroeth the array":-)
--
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
Life is complex, with real and imaginary parts.
------------------------------
Date: Mon, 19 Jun 2000 10:33:47 +0100
From: "mike solomon" <mike.solomon@eps.ltd.uk>
Subject: capturing warnings from lpstat
Message-Id: <8ikpen$52qem$1@fu-berlin.de>
Operating System AIX 4.3.2
I am in the process of creating a script to check if any printers are down
then if so enable them
I have started with the following script
#! /usr/local/bin/perl
#netprint.pl
#Mon 19 Jun 10:01:33 2000 itdmjs
#enable printers that are down
open(LSALLQ, 'lsallq|') or die "cannot pipe from lsallq";
while(<LSALLQ>) {
open(STAT,"lpstat -p$_|") or die "cannot pipe from lpstat";
close(STAT);
}
the problem I have is that lpstat gives warning if it can not connect to the
printer such as :
rembak: (WARNING): Connection to server failed, errno=4.
I want to capture these warnings and use them in the script
I could redirect them to a file and then read the file but I was hoping that
there might be a more elegant way to capture them
any help would be appreciated
regards
Mike Solomon
------------------------------
Date: Mon, 19 Jun 2000 10:25:26 +0200
From: Markus Hediger <hedim@hta-bi.bfh.xxx>
Subject: Re: Content type !!
Message-Id: <394DD8F6.F51B35D5@hta-bi.bfh.xxx>
Robert Metcalf wrote:
> > > print "Content-type: text/html\n\n";
> > > print "Hello World\n";
> >
> This is what I get when I try to run a script without having
> permision to run scripts in that dir from the server
correct: as long as the server mustn't execute the file, it offers it
for download, no matter of what type it is. and .pl is of type text/...,
so the browser displays it as text.
but as abigail says some messages below:
this is actually a cgi question.
regards
markus
------------------------------
Date: Sun, 18 Jun 2000 23:11:46 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Crazy enough that it might just work...
Message-Id: <slrn8kr3ri.d0s.tadmc@magna.metronet.com>
On Sun, 18 Jun 2000 17:49:48 -0700, Agentkhaki <altavistaNOalSPAM@agentkhaki.com.invalid> wrote:
>I've been
>doing HTML programming
HTML is not a Programming Language, so "doing HTML programming"
is impossible.
( can you write an "HTML program" to add 2 numbers? )
HTML is a Markup Language (that's what the "ML" in the name stands for).
A Programming Language and a Markup Language are different things,
and serve different purposes. Confusing them is..., well, confusing :-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 19 Jun 2000 11:17:44 +0200
From: "MAP" <map@usnavy.gov>
Subject: Re: Dir Listsing
Message-Id: <0E16861EE7BCD111BE9400805FE6841F1092D303@c1s5x001.cor.srvfarm.origin-it.com>
can you send me the source of that program (directory listing)??
email me to : map_publik at yahoo.com
"psycho" <psychoNOpsSPAM@pcpatches.com.invalid> wrote in message
news:1e9f04e3.8047d5e1@usw-ex0102-013.remarq.com...
> hey, i've got a question. Im doing this script for some one, and
> all it does is read's the dir and put's it out in to what ever i
> want it to look like, but that's not the probelm. The probelm is
> that on the server default listing it has the filename, last
> modifed, size and crap i was woundering if theres a way to get
> the size and the last modified, and des. So that i dont have to
> have a file that has all the listings crap for the dir. in a
> file.. if you know how to get the information. please bemy guest
> and tell me.. =)
>
>
> Thanks,
> Psycho
>
> Got questions? Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com
------------------------------
Date: 19 Jun 2000 09:04:01 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Does anyone have some exercises?
Message-Id: <8ikk5h$qvk$1@orpheus.gellyfish.com>
On 15 Jun 2000 22:51:11 -0400 David Wall wrote:
> care227@attglobal.net (Drew Simonis) wrote in
> <39492D64.FDF1CF5A@attglobal.net>:
>>Tad McClellan wrote:
>>>
>>>
>>> You can even modify #1 so that you _post_ your solution, then
>>> watch as it gets torn down and redone :-)
>>>
>>
>>Oh the pain. The shame and the pain. Hmm..
>>
>>I think I've only mumbled "I'm a moron" 5 times so far today, and
>>only 4 were because of foolish postings.
>>
>>I'm improving so much.
>
> I'm glad I'm not alone.... I don't post as much as you two, so I have fewer
> opportunities to embarrass myself, but I've posted some dumb things, too.
> (I hesitate to even estimate the proportions for fear of extreme damage to
> my ego) A few days ago someone asked how to encrypt and *decrypt* a
> string. I saw 'crypt', and thought, "Ooh, I can help here!", and
> immediately posted a one-line reply of 'perldoc -f crypt'. I felt so
> stupid when someone pointed out that it's <understatement>slightly
> difficult</understatement> to decrypt a string encrypted with crypt(), and
> my reply was not even on the right track.
>
Not reading the question properly is probably the most common error.
Well for me that and posting on a saturday night after I've been in the
pub all day ;-}
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 19 Jun 2000 09:24:46 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: Dumb question.. How to prompt the user and get the input.
Message-Id: <8ikosu$15up$1@nntp1.ba.best.com>
In article <MPG.13b162d22f71e0098ab73@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>It has functions fgetc(), getc(), and getchar() to read a single character
>from an input stream. All this is specified and supported portably.
But getc() when reading from the terminal causes the program to wait
until the user has typed an entire line. After the user has hit the
RETURN/ENTER/NEWLINE key, then getc() will return just the first character
that was typed. This is not the same as the desired result, which is
to wait for the user to enter just a single character and return it.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: 19 Jun 2000 09:08:48 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Exporting
Message-Id: <8ikkeg$rt6$1@orpheus.gellyfish.com>
On Thu, 15 Jun 2000 16:39:38 GMT tlars@my-deja.com wrote:
> In Module A I'd like to Export a function that I get when I "use B;".
>
> Therefore,
>
> package B;
>
> @EXPORT qw (
> foo
> );
> -------------------
> package A;
>
> use B;
>
> Export qw(foo);
>
> Is this possible?
>
In the immortal words - what happened when you tried ?
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 19 Jun 2000 09:15:10 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: Extract filename from path?
Message-Id: <8ikoau$15g2$1@nntp1.ba.best.com>
In article <skfeckb8is450@corp.supernews.com>,
Craig Berry <cberry@cinenet.net> wrote:
>Henrik Jönsson (henrik.jonsson@se.adtranz.com) wrote:
> sub basename {
> return (split m!/|\\!, shift)[-1];
> }
Q: The file name is separated from the directory name with
A) a forward slash
B) a back slash
C) a colon
D) a semicolon
E) all of the above.
The correct answer is E.
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Mon, 19 Jun 2000 12:45:47 +0300
From: "Denys Kotseba" <kdl@softhome.net>
Subject: Freestanding COM object
Message-Id: <961408109.108738@ipt2.iptelecom.net.ua>
Hello,
I faced a problem creating a freestanding component (source code attached)
using PerlCtrl. While the dependent component out of the same code works
fine, the freestanding one produces following errors:
Can't_locate_URI::_foreign_in_@INC_(@INC_contains:_._C:\WINNT\TEMP\custhttp\
{AC0590D5-5864-46A2-BCEB-2821B1E57D70}\)_at_(eval_1)_line_110._ 500
If I include URI::_foreign and connected libraries explicitly, the following
error is produced:
Can't_locate_object_method__host__via_package__URI::_foreign__at_(eval_19)_l
ine_41._ 500
Could you please point out what is my mistake? The source code is found
below.
Thank you.
Denys Kotseba.
----- A piece of VBScript code using the object
set objHTTP = CreateObject("CustHTTP.Send")
objHTTP.SetBase "http://www.somewhere.com"
objHTTP.Post "default.asp?action=dosomething","param1=value1¶m2=value2"
MsgBox "Returned:" & objHTTP.Code
----- custhttp.pm -------
package CustHTTP;
use strict;
use LWP::UserAgent;
use HTTP::Cookies;
#use URI::_foreign;
#use URI::_generic;
#use URI::_query;
use vars qw($URL $Query $BaseURL $Code $Content);
my ($method,$error,$response);
my $cookie_jar = new HTTP::Cookies;
my $agent = new LWP::UserAgent;
$agent->agent('Mozilla/5.0');
sub SetBase {
$BaseURL = shift;
return $BaseURL
}
sub Get {
($URL,$Query) = @_;
$method = 'get';
if (getpage()) {
$Code = $response->code;
$Content = $response->content;
return 0
}
else {
return -1
}
}
sub Post {
($URL,$Query) = @_;
$method = 'post';
if (getpage()) {
$Code = $response->code;
$Content = $response->content;
return 0
}
else {
return -1
}
}
sub getpage {
if (!defined($URL) || $URL =~ /^$/) {
$response = 'No URL specified';
return 0
}
my $req = new HTTP::Request;
if ($method =~ /get/i) {
$req->method('GET');
}
elsif ($method =~ /post/i) {
if (!defined($Query) || $Query =~ /^$/) {
$response = 'Query parameter required when POSTing';
return 0
}
$req->method('POST');
$req->content_type('application/x-www-form-urlencoded');
$req->content($Query);
}
if (!defined($BaseURL) || $BaseURL=~ /^$/) {$BaseURL = ''}
$req->uri($BaseURL.$URL);
$response = $agent->request($req);
return 1
}
1;
#===========================================================================
===================
=POD
=BEGIN PerlCtrl
%TypeLib = (
PackageName => 'CustHTTP',
TypeLibGUID => '{0535CFAC-E7D8-48B5-B2AD-D55F44573E1D}', # do NOT edit this
line
ControlGUID => '{A5B1B4CF-502C-4B4D-816E-D2A86217BD79}', # do NOT edit this
line either
DispInterfaceIID=> '{F19E5591-BC59-4BC7-A2A6-20169FE687E6}', # or this one
ControlName => 'Custom HTTP calls',
ControlVer => 1.05, # increment if new object with same ProgID
# create new GUIDs as well
ProgID => 'CustHTTP.Send',
DefaultMethod => 'Get',
Methods => {
'Get' => {
RetType => VT_I4,
TotalParams => 2,
NumOptionalParams => 1,
ParamList =>[ 'URL' => VT_BSTR,
'Query' => VT_BSTR ]
},
'Post' => {
RetType => VT_I4,
TotalParams => 2,
NumOptionalParams => 0,
ParamList =>[ 'URL' => VT_BSTR,
'Query' => VT_BSTR ]
},
'SetBase' => {
RetType => VT_BSTR,
TotalParams => 1,
NumOptionalParams => 0,
ParamList =>[ 'BaseURL' => VT_BSTR ]
},
}, # end of 'Methods'
Properties => {
'Code' => {
Type => VT_I4,
ReadOnly => 1,
},
'Content' => {
Type => VT_BSTR,
ReadOnly => 1,
},
'BaseURL' => {
Type => VT_BSTR,
ReadOnly => 0,
},
}, # end of 'Properties'
); # end of %TypeLib
=END PerlCtrl
=cut
------------------------------
Date: 18 Jun 2000 22:04:38 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: good books for beginning Perl?
Message-Id: <8ijdh6$d6q$1@orpheus.gellyfish.com>
On Sun, 18 Jun 2000 12:34:48 +0100 John Heath wrote:
> Picked up a cracking one yesterday - no good as a full reference, but
> brilliant for learning the basics. Very impressed with it.
>
> Elizabeth Castro
> Perl & CGI for the world wide web
>
Perhaps the guy was interested in some application area other than the
CGI ? A general book on programming and a general book on Perl might
be more appropriate.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 18 Jun 2000 21:59:25 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: good books for beginning Perl?
Message-Id: <8ijd7d$c69$1@orpheus.gellyfish.com>
On Sun, 18 Jun 2000 09:45:39 -0700 damonr wrote:
> http://www.devcritic.com/bookstore/serverside/Perl.php3
^^^^
Oh the irony of it all. I would recommend Uri's page that can be found
somewhere around <http://www.sysarch.com> .
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 19 Jun 2000 08:37:47 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to decode binhex encoded email attachments?
Message-Id: <8ikikb$ltj$1@orpheus.gellyfish.com>
On Thu, 15 Jun 2000 21:52:27 GMT ahy wrote:
> I really need help on decoding binhex encoded email attachments.
There is a module available from CPAN (Convert::BinHex) that might help.
You will find <http://search.cpan.org> will help next time.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 19 Jun 2000 05:40:34 GMT
From: mbadolato@cybernox.com (Mark Badolato)
Subject: Re: I can't figure this one out... (Newbie question)
Message-Id: <8F57E3B9Fmbadolatocybernoxcom@206.165.3.80>
news@tinita.de (Tina Mueller) wrote in <8ijvc3$50if4$2@fu-berlin.de>:
>you can use what you like most, AFAIK there's no
>difference in efficiency.
use Benchmark;
timethese(100000, {
'add one' => '
my $num;
$num = $num + 1 for (1..100);
',
'plus equals' => '
my $num;
$num += 1 for (1..100);
',
'plus plus' => '
my $num;
$num++ for (1..100);
',
});
Results:
Benchmark: timing 100000 iterations of add one, plus equals, plus
plus...
add one: 16 wallclock secs (15.17 usr + 0.00 sys = 15.17 CPU)
plus equals: 12 wallclock secs (12.52 usr + 0.00 sys = 12.52 CPU)
plus plus: 8 wallclock secs ( 9.60 usr + 0.00 sys = 9.60 CPU)
--mark
------------------------------
Date: Mon, 19 Jun 2000 08:27:33 +0200
From: Johannes <gedichte@lycosmail.com>
Subject: Re: link to a module when perl program starts
Message-Id: <394DBD55.1DA8D68E@lycosmail.com>
PC Leung wrote:
> hello
>
> I want my perl program to link a POP3Client.pm
> in a specific directory because my ISP does not
> have this module.
You can tell your programs to look in a different directory by using
lib.
use lib('/path/to/my/private/modules');
use private_module;
- Johannes
------------------------------
Date: Mon, 19 Jun 2000 10:32:44 +0200
From: VAHAGN AVEDIAN <etxaved@etxb.ericsson.se>
Subject: Mailing in PERL/CGI
Message-Id: <394DDAAC.AD902646@etxb.ericsson.se>
This is a multi-part message in MIME format.
--------------703F746DE902C24D5F5FFF58
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I've a domain name of my own but when I send emails using
PERL the receiver gets a mail with 'nobody@servername.com' as sender.
Is there a way to send the mail so the sender looks like
'myname@mydomain.com'?
Is there a mail module in PERL so you can set the 'subject' field
etc. in the outgoing mail???
Anyone that can mail me the answer to: etxaved@etxb.ericsson.se...
Thanks,
Vahagn
--
-------------------------------------------------------------------
Email: etxaved@etxb.ericsson.se
Tel Ericsson: +46 (0)8 719 82 03
Tel Mobile : +46 (0)707 73 33 83
--------------703F746DE902C24D5F5FFF58
Content-Type: text/x-vcard; charset=us-ascii;
name="etxaved.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for VAHAGN AVEDIAN
Content-Disposition: attachment;
filename="etxaved.vcf"
begin:vcard
n:Avedian;Vahagn
tel;cell:+46 (0)707 73 33 83
tel;fax:+46 (0)8 719 77 50
tel;home:+46 (0)18 15 59 09
tel;work:+46 (0)8 719 82 03
x-mozilla-html:FALSE
url:http://www.csd.uu.se/~d93vav
adr;quoted-printable;quoted-printable:;;Varuv=E4gen 9B=0D=0A=C4V/ETX/D/XAGL;=C4lvsj=F6;Stockholm;S-126 25;Sweden
version:2.1
email;internet:etxaved@etxb.ericsson.se
title:Software design
org;quoted-printable:Ericsson Telecom AB;=C4V/D/XAGL
x-mozilla-cpt:;23168
fn:Vahagn Avedian
end:vcard
--------------703F746DE902C24D5F5FFF58--
------------------------------
Date: Mon, 19 Jun 2000 10:51:58 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Mailing in PERL/CGI
Message-Id: <u8rrkssmrajbvb510jkvv4787darne3b4k@4ax.com>
On Mon, 19 Jun 2000 10:32:44 +0200, VAHAGN AVEDIAN
<etxaved@etxb.ericsson.se> wrote:
>I've a domain name of my own but when I send emails using
>PERL the receiver gets a mail with 'nobody@servername.com' as sender.
>
>Is there a way to send the mail so the sender looks like
>'myname@mydomain.com'?
>
>Is there a mail module in PERL so you can set the 'subject' field
>etc. in the outgoing mail???
>
>Anyone that can mail me the answer to: etxaved@etxb.ericsson.se...
Download the Mail::Tools bundle from CPAN and use that.
hth,
Dave...
--
<http://www.dave.org.uk> SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>
"There ain't half been some clever bastards" - Ian Dury [RIP]
------------------------------
Date: Mon, 19 Jun 2000 09:48:39 +0200
From: Jan van Mansum <Jan.vanMansum@s1.com>
Subject: Messagebox in Win32
Message-Id: <394DD056.EA148C0C@s1.com>
Hello all,
I want to do something that must be simple. I want to display a
messagebox in Win32 (with ActivePerl). How do you do that?
Thanks.
Regards,
Jan van Mansum.
------------------------------
Date: Mon, 19 Jun 2000 05:35:20 -0400
From: "Joe Giuffrida" <giuffridaj@netzero.net>
Subject: Re: Messagebox in Win32
Message-Id: <skrq1nbce7f141@corp.supernews.com>
You need the Win32-API module which allows you to call into NT DLLs. Sample
code for a message box is as follows:
use Win32::API;
$flags = 0x1021; # Just the OK button
$MessageBox = new Win32::API ( "user32", "MessageBox", [N, P, P, I], N );
$status = $MessageBox->Call ( 0, "Your message", "Your title", $flags );
Jan van Mansum <Jan.vanMansum@s1.com> wrote in message
news:394DD056.EA148C0C@s1.com...
> Hello all,
>
> I want to do something that must be simple. I want to display a
> messagebox in Win32 (with ActivePerl). How do you do that?
>
> Thanks.
>
> Regards,
>
> Jan van Mansum.
>
------------------------------
Date: Mon, 19 Jun 2000 09:32:38 GMT
From: Michael Blomkvist <halvfem@hotmail.com>
Subject: Multidimensional array.
Message-Id: <394DE86A.9C7770F9@hotmail.com>
I have a twodimensional array, called data, and I want to print out the
whole array at, for example, data[0], so if the array has n values it
would be the same as $data[0][0] $data[0][1]...$data[0][n], so I tried
just using this:
print("@data[0]");
Which gives me "ARRAY(0x805d4d8)". Why is that, and how should I do? If
it would be onedimensional "print("@data");" would print out the whole
array, so why doesn't this work?
------------------------------
Date: Mon, 19 Jun 2000 09:45:18 GMT
From: garcia_suarez@hotmail.com (Rafael Garcia-Suarez)
Subject: Re: Multidimensional array.
Message-Id: <slrn8krr4v.v39.garcia_suarez@rafael.kazibao.net>
Michael Blomkvist wrote in comp.lang.perl.misc:
>I have a twodimensional array, called data, and I want to print out the
>whole array at, for example, data[0], so if the array has n values it
>would be the same as $data[0][0] $data[0][1]...$data[0][n], so I tried
>just using this:
>
>print("@data[0]");
>
>Which gives me "ARRAY(0x805d4d8)". Why is that, and how should I do?
@data[0] is an array slice, and it's equivalent to $data[0].
You should print "@{$data[0]}", which means: take the first element of @data,
and dereference it as an array.
--
Rafael Garcia-Suarez
------------------------------
Date: Mon, 19 Jun 2000 09:54:58 GMT
From: Michael Blomkvist <halvfem@hotmail.com>
Subject: Re: Multidimensional array.
Message-Id: <394DEDA6.4E2FB673@hotmail.com>
I understand. Thank you very much for your answer.
> @data[0] is an array slice, and it's equivalent to $data[0].
>
> You should print "@{$data[0]}", which means: take the first element of @data,
> and dereference it as an array.
>
> --
> Rafael Garcia-Suarez
------------------------------
Date: Mon, 19 Jun 2000 10:59:15 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Multidimensional array.
Message-Id: <ckrrks0u7rl6b5jbc2jbqvo1abu7c3f392@4ax.com>
On Mon, 19 Jun 2000 09:32:38 GMT, Michael Blomkvist
<halvfem@hotmail.com> wrote:
>I have a twodimensional array, called data, and I want to print out the
>whole array at, for example, data[0], so if the array has n values it
>would be the same as $data[0][0] $data[0][1]...$data[0][n], so I tried
>just using this:
>
>print("@data[0]");
>
>Which gives me "ARRAY(0x805d4d8)". Why is that, and how should I do? If
>it would be onedimensional "print("@data");" would print out the whole
>array, so why doesn't this work?
You need to re-read perllol and perldsc (and perhaps perlreftut and
perlref). They would explain exactly where you're going wrong.
Here are a couple of ideas to get you going...
#!/usr/bin/perl -w
use strict;
my @data = ([1, 2, 3],
[4, 5, 6],
[7, 8, 9]);
print map { "@{$data[$_]}\n" } 0 .. 2;
print '=' x 10, "\n";
print map { "@$_\n" } @data;
hth,
Dave...
--
<http://www.dave.org.uk> SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>
"There ain't half been some clever bastards" - Ian Dury [RIP]
------------------------------
Date: 19 Jun 2000 08:46:01 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Name/Value pair for a hyperlink?
Message-Id: <8ikj3p$ngf$1@orpheus.gellyfish.com>
On Fri, 16 Jun 2000 11:18:48 -0400 Drew Simonis wrote:
> "Alan J. Flavell" wrote:
>>
>> On Fri, 16 Jun 2000, Drew Simonis wrote:
>>
>> > > I find I know which spec to consult when there's
>> > > something I need, and can rattle off RFC2616 or iso-8859-7 with the
>> > > rest of them.
>> >
>> > You mean there are _others_?
>
> heh... I meant others that can rattle off RFCs and iso docs.
>
> (why do I have a disturbed mental image of lots of Brits )
> . o O (gathering in a pub and discussing RFCs over a pint of bitter)
> (AND why am I silenty envious! )
I dont know about Alan's neck of the woods but this has been known to
happen. Its when people try to get their beer orders in by beaming them
from their Palm Pilots you know you are in trouble .... ;-}
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Sun, 18 Jun 2000 23:14:46 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Need Help ! Please Read !
Message-Id: <slrn8kr416.d0s.tadmc@magna.metronet.com>
On Sun, 18 Jun 2000 20:30:12 -0700, psycho <psychoNOpsSPAM@pcpatches.com.invalid> wrote:
> Subject: Need Help ! Please Read !
Need Subject ! Please Write !
>But have you seen what
>server defaut dir. listing look like?
No.
Why do you ask?
>is there a way to get the
>size, last modified, and des if any from the server?
perldoc -f stat
>Got questions? Get answers over the phone at Keen.com.
What, they don't answer rudimentary Perl questions there?
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 19 Jun 2000 08:07:08 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Need help with timelocal
Message-Id: <8ikgqs$g0a$1@orpheus.gellyfish.com>
On Thu, 15 Jun 2000 21:53:18 -0700 Tom Phoenix wrote:
> On Fri, 16 Jun 2000, Dominic Bishop wrote:
>
>> I am trying to use the timelocal function to compare 2 dates and find
>> the difference between them, although this is a bit crude it is
>> accurate enough for my purposes and with the server belonging to my
>> ISP I don't have the option of installing something like Date::Calc.
>
> Get a better ISP; good sysadmins know how to install software. I haven't
> figured out why anyone pays the ones who don't.
>
> But if you insist on doing it without a module, here's what you do.
> Download a good module like Date::Calc, cut the code, paste it into your
> program. _Much_ easier than starting the algorithm from scratch.
>
I would guess that he wouldnt want to try that with Date::Calc as the module
is largely XS code ;-}
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
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 3417
**************************************