[22052] in Perl-Users-Digest
Perl-Users Digest, Issue: 4274 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 17 06:05:54 2002
Date: Tue, 17 Dec 2002 03:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 17 Dec 2002 Volume: 10 Number: 4274
Today's topics:
DBI::mysql Problem on Linux <jeff@jeffs-place.org>
Re: DBI::mysql Problem on Linux <palladium@spinn.net>
Re: DBI::mysql Problem on Linux <jeff@jeffs-place.org>
Re: DBI::mysql Problem on Linux <palladium@spinn.net>
exitcode = -13 ? <pilsl_use@goldfisch.at>
Glob: funny behaviour (JFT)
Re: How to reference multiple keys from a hashref? (Anno Siegel)
Re: In place edit with $^I and multiple files, keeping (qanda)
Re: In place edit with $^I and multiple files, keeping (qanda)
Re: In place edit with $^I and multiple files, keeping <krahnj@acm.org>
Re: Is it possible to change windows background via Per <palladium@spinn.net>
Re: Mail::POP3Client faliure,...? <palladium@spinn.net>
Re: OK, I give up - merge different fields from 2 files (qanda)
Re: PErl and CSS (M Browning)
Re: Perl preinstalled. bad @INC (M Browning)
Re: Perl preinstalled. bad @INC <nobull@mail.com>
Re: Setting DOS buffer size. <spikey-wan@bigfoot.com>
Re: Using a hash as a reference is deprecated <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 17 Dec 2002 06:00:55 GMT
From: "Jeff Walter" <jeff@jeffs-place.org>
Subject: DBI::mysql Problem on Linux
Message-Id: <r4zL9.374620$%m4.121048@rwcrnsc52.ops.asp.att.net>
I've written an application which uses the DBI module to access a MySQL
database. On Windows I have the "mysqlPP" driver for DBI, but I couldn't
get it on Linux so I ended up with the "mysql" driver instead. Using the
same code other than the driver specification I got the following error in
Linux:
@houston.jeffs-place.org' (Using password: YES) at ./nickserv.pl line 56
I'm not sure what this means. The MySQL server is the same. Is it an
issue with the "mysql" driver? It did work for a while, so I'm completely
stumped.
Any help would be greatly appreciated.
Jeff Walter
jeff@jeffs-place.org
------------------------------
Date: Tue, 17 Dec 2002 00:25:54 -0700
From: "Rod" <palladium@spinn.net>
Subject: Re: DBI::mysql Problem on Linux
Message-Id: <uvtkgptj6kake0@corp.supernews.com>
"Jeff Walter" <jeff@jeffs-place.org> wrote in message
news:r4zL9.374620$%m4.121048@rwcrnsc52.ops.asp.att.net...
> I've written an application which uses the DBI module to access a
MySQL
> database. On Windows I have the "mysqlPP" driver for DBI, but I couldn't
> get it on Linux so I ended up with the "mysql" driver instead. Using the
> same code other than the driver specification I got the following error in
> Linux:
>
> @houston.jeffs-place.org' (Using password: YES) at ./nickserv.pl line 56
>
> I'm not sure what this means. The MySQL server is the same. Is it an
> issue with the "mysql" driver? It did work for a while, so I'm completely
> stumped.
> Any help would be greatly appreciated.
>
> Jeff Walter
> jeff@jeffs-place.org
Jeff a code sample of the DBI connection and pertinant parts would help us
to determine what the problem is.
In the meantime try reading:
perldoc DBI
This has great information on the DBI module.
They show a couple of samples of the connection like this:
"connect"
$dbh = DBI->connect($data_source, $username, $password)
|| die $DBI::errstr;
$dbh = DBI->connect($data_source, $username, $password, \%attr)
|| die $DBI::errstr;
You did not post the entire error string either.
Give us more information.
Thanks,
Rod
------------------------------
Date: Tue, 17 Dec 2002 08:01:59 GMT
From: "Jeff Walter" <jeff@jeffs-place.org>
Subject: Re: DBI::mysql Problem on Linux
Message-Id: <XRAL9.254986$GR5.87362@rwcrnsc51.ops.asp.att.net>
Here's the code:
use DBI:
my $dsn = "dbi:mysql:database=$database;host=$hostname";
(my $dbh = DBI->connect($dsn, $user, $password)) || die " FAILED\n\n";
my $drh = DBI->install_driver($driver);
It fails on the DBI->connect with:
@localhost.localdomain' (Using password: YES) at ./nickserv.pl line 56
All the variables are set to the correct values, as they work in Windows.
I'm stumped.
Jeff Walter
jeff@jeffs-place.org
------------------------------
Date: Tue, 17 Dec 2002 01:15:47 -0700
From: "Rod" <palladium@spinn.net>
Subject: Re: DBI::mysql Problem on Linux
Message-Id: <uvtneap9629v73@corp.supernews.com>
"Jeff Walter" <jeff@jeffs-place.org> wrote in message
news:XRAL9.254986$GR5.87362@rwcrnsc51.ops.asp.att.net...
> Here's the code:
>
> use DBI:
> my $dsn = "dbi:mysql:database=$database;host=$hostname";
> (my $dbh = DBI->connect($dsn, $user, $password)) || die " FAILED\n\n";
> my $drh = DBI->install_driver($driver);
>
> It fails on the DBI->connect with:
> @localhost.localdomain' (Using password: YES) at ./nickserv.pl line 56
>
I am no DBI expert, but it seems as if the connect if I remember correctly
installs the driver if it's not installed already.
Could this be a case of reinitializing the driver after it's already loaded
specifically with the Driver Handle?
What happens when you run with with:
use Strict;
perldoc DBI also mentions the following possibly pertinant information.
$drh Driver handle object (rarely seen or used in applications)
Do you have a specific reason for doing this?
"DBI-">"connect" automatically installs the driver if it has not
been installed yet. Driver installation either returns a valid
driver handle, or it *dies* with an error message that includes the
string ""install_driver"" and the underlying problem. So
"DBI-">"connect" will die on a driver installation failure and will
only return "undef" on a connect failure, in which case
"$DBI::errstr" will hold the error message.
------------------------------
Date: Tue, 17 Dec 2002 11:52:13 +0100
From: peter pilsl <pilsl_use@goldfisch.at>
Subject: exitcode = -13 ?
Message-Id: <3dff0202$1@e-post.inode.at>
I got the following problems with my perlscript (its a mailer
procmail/sendmail):
procmail: Program failure (-13) of
"/usr/local/sbin/mailscripts/mail_ext_aid.pl"
I was now searching the perl-doc for its exitcodes but I seem to use the
wrong term, cause "exitcode" doesnt appear.
Maybe anyone could point me to the right documentation where I'll find the
meaning of this exitcode.
Additionally I'd appretiate comments on how to debug such problems in
productional environment. The error occures one out of 5000 times the
script is called and is not reproduceable. Is there a way to execute a
subroutine whenever perl would exit with this error (so I can try to log
additional information) and/or to find out at which line the error occured.
thnx a lot,
peter
--
peter pilsl
pilsl_@goldfisch.at
http://www.goldfisch.at
------------------------------
Date: 17 Dec 2002 01:47:13 -0800
From: jeanthil@hotmail.com (JFT)
Subject: Glob: funny behaviour
Message-Id: <af779696.0212170147.41b44adf@posting.google.com>
Dear all,
I am using glob on a Win32 box and found a strange behaviour that I
hope you will be able to explain.
When trying to use glob with a UNC, it does not work if I am using a
"\" but it works with a "/"
Here is an example:
@files=glob("\\\\servername\\sharename\\directory\\*.txt"); Does not
work
@files=glob("//servername/sharename/directory/*.txt"); Works
Do you have an explanantion?
------------------------------
Date: 17 Dec 2002 10:03:22 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to reference multiple keys from a hashref?
Message-Id: <atmspa$3hm$1@mamenchi.zrz.TU-Berlin.DE>
According to Darren Dunham <ddunham@redwood.taos.com>:
> Jeff 'japhy' Pinyan <pinyaj@rpi.edu> wrote:
[...]
> > Therefore:
>
> > @items = @{$hashref}{"alpha", "charlie"};
>
> Duh, yes. For some reason I was too concerned about trying to continue
> using the arrow operator. Obviously, that's not necessary at all for
> this case.
The result of an arrow dereference is *always* a scalar, so it can't be
the right operator for a slice.
Anno
------------------------------
Date: 16 Dec 2002 23:02:01 -0800
From: fumail@freeuk.com (qanda)
Subject: Re: In place edit with $^I and multiple files, keeping SOME originals.
Message-Id: <62b4710f.0212162302.2576fbfd@posting.google.com>
Thanks for the feedback.
"John W. Krahn" <krahnj@acm.org> wrote in message news:<3DFE4CC4.A0FF1C2F@acm.org>...
> qanda wrote:
> >
> > Hi all, in line with previous posts I have this ...
> >
> > #!/usr/bin/perl -w
> >
> > use diagnostics -verbose;
> > use warnings;
>
> Using the -w switch and both the diagnostics and warnings pragmas is a
> bit redundant.
Thanks for pointing it out, what should I be using then?
>
>
> > use strict;
> >
> > extract_recs();
> >
> > sub extract_recs {
> > open( RECA, ">reca.out" ) or die "Can't open reca.\n";
> > open( RECB, ">recb.out" ) or die "Can't open recb.\n";
> >
> > # In place edit by <> construct.
> > local $^I = '.orig';
> > local @ARGV = glob("abc*.dat");
> >
> > # For each file.
> > while ( <> )
> > {
> > # Ingore blank lines.
> > next if /^\s+$/;
> >
> > # Split records into fields.
> > my @type = split( /,/, $_, -1 );
> >
> > # Save valid type A records.
> > if( $type[2] eq 'A' && $type[5] ) {
> > print RECA;
> > }
> > # Save valid type B records.
> > elsif( $type[2] eq 'B' && $type[5] ) {
> > print RECB;
> > }
> > else {
> > print;
> > }
> >
> > # Check something else in current file
> > # if OK do_action_1 then delete orig file
> > # else do_action_2 then keep orig file
>
> if ( eof ) {
> close ARGV;
> if ( something_else ) {
> do_action_1();
> unlink "$ARGV$^I" or warn "Cannot delete $ARGV$^I: $!";
> }
> else {
> do_action_2();
> }
> }
>
>
> > }
> > }
Thanks for example, I'll try it out.
> > Example data in files ...
> >
> > [snip]
> >
> > First note I used a comma as the separator so it could be seen here,
> > in fact it is a backspace or delete character.
> >
> > I would like to test some condition within each file and depending on
> > the result either remove or keep the original. The above seems to
> > work OK however I don't know how to reference the individual files.
> >
> > One other query, since discovering the wonderful __DATA__ idea I use
> > this for example data, can we replicate MULTIPLE files using this?
>
> Yes you can.
>
> http://search.cpan.org/author/DCONWAY/Inline-Files-0.60/
Just bookmarked it, cheers!
>
>
> John
------------------------------
Date: 17 Dec 2002 00:45:24 -0800
From: fumail@freeuk.com (qanda)
Subject: Re: In place edit with $^I and multiple files, keeping SOME originals.
Message-Id: <62b4710f.0212170045.c5ada96@posting.google.com>
Thanks John, I've checked this now ...
> >
> > # Check something else in current file
> > # if OK do_action_1 then delete orig file
> > # else do_action_2 then keep orig file
>
> if ( eof ) {
> close ARGV;
> if ( something_else ) {
> do_action_1();
> unlink "$ARGV$^I" or warn "Cannot delete $ARGV$^I: $!";
> }
> else {
> do_action_2();
> }
> }
That didn't seem to work for me, however it pointed me in the right
direction so I changed it to use the continue block around the if eof
block which seems to work OK.
It was especially useful seeing how to reference each file within the
loop, ie the original and the copy.
Thanks again.
------------------------------
Date: Tue, 17 Dec 2002 10:02:23 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: In place edit with $^I and multiple files, keeping SOME originals.
Message-Id: <3DFEF5EC.377EC828@acm.org>
qanda wrote:
>
> Thanks for the feedback.
> "John W. Krahn" <krahnj@acm.org> wrote in message news:<3DFE4CC4.A0FF1C2F@acm.org>...
> > qanda wrote:
> > >
> > > Hi all, in line with previous posts I have this ...
> > >
> > > #!/usr/bin/perl -w
> > >
> > > use diagnostics -verbose;
> > > use warnings;
> >
> > Using the -w switch and both the diagnostics and warnings pragmas is a
> > bit redundant.
> Thanks for pointing it out, what should I be using then?
perldoc diagnostics
[snip]
To use in your program as a pragma, merely invoke
use diagnostics;
at the start (or near the start) of your program. (Note
that this does enable perl's -w flag.) Your whole
compilation will then be subject(ed :-) to the enhanced
diagnostics. These still go out STDERR.
Which means that if you are using the diagnostics pragma the -w switch
will be enabled and the warnings pragma does pretty much what the -w
switch does so you pretty much just need one of the three. If you are
still fairly new to Perl you should probably stick with the diagnostics
pragma as it provides more descriptive (verbose) warning and error
messages.
John
--
use Perl;
program
fulfillment
------------------------------
Date: Mon, 16 Dec 2002 22:40:25 -0700
From: "Rod" <palladium@spinn.net>
Subject: Re: Is it possible to change windows background via Perl?
Message-Id: <uvteb19hdcnp67@corp.supernews.com>
"Jim Agnew" <jpagnew@vcu.edu> wrote in message
news:3DFDF142.A1E1E9BC@vcu.edu...
> i have a website (http://www.ssec.wisc.edu/data/east/latest_eastvis.gif)
> that the image I'd then take and make it my background, haveing a live
> satellite map of the eastern us on my desktop... (one of my few toys).
>
> I could automate this on vax/vms using xv from a subprocess (or child
> process)
>
> is it possible to automate this using Perl? Any pointers to how to do
> the windows background would be helpfull, and i already have most of the
> other stuff like ftp'ing the image down, the timing, etc..
>
> Thanks!!!
Seems as if different Versions of Windows Behave differently with this, but
on my win2k box it works as intended.
#!perl
use strict;
use Win32::TieRegistry;
my $HiveKey="CUser\\Control Panel\\Desktop";
my $PathtoNew="c:\\sat_image.bmp";
if (-e $PathtoNew){
my $HiveRoot=$Registry->{$HiveKey} or die "Can't Open Registry Key
$HiveKey : $^E\n";
my $CurrentWallpaper="Wallpaper";
my $CurrentPathtoBitmap=$HiveRoot->{$CurrentWallpaper} or die "Can't
Get Current Value of $HiveKey\\Wallpaper: $^E";
my $SetOriginalWallpaper="OriginalWallpaper";
$HiveRoot->{$SetOriginalWallpaper}=$CurrentPathtoBitmap or die "Can't
Set $HiveKey\\OriginalWallpaper to $CurrentPathtoBitmap: $^E";
$HiveRoot->{$CurrentWallpaper}=$PathtoNew or die "Can't Set
$HiveKey\\Wallpaper to $PathtoNew: $^E";
};
Not sure if your wallpaper allows for gif files either...might have to do a
little converting.
Rodney
------------------------------
Date: Tue, 17 Dec 2002 00:55:22 -0700
From: "Rod" <palladium@spinn.net>
Subject: Re: Mail::POP3Client faliure,...?
Message-Id: <uvtm81gk3pnu62@corp.supernews.com>
"mUs" <cmustard_!SPAM@nyc.rr.com> wrote in message
news:slrnavtb74.1c3.cmustard_!SPAM@nyc.rr.com...
>
> Ok, this is very frustrating, 2 days and many hours worth! I have used
this
> module/lib (libwww) before with ease (on other distro's). I just installed
> this module on my Debian Woody 3.0 box and it's not working.
> It seems like an encryption error (?).
>
> The following is the exact script i am trying to run, (except with my
> personal info removed) and below is the Debugging info i'm getting.
>
> All my supplied data is correct, (i.e. username and password, i use the
exact
> same info for ~/.fetchmailrc and i retrieve mail fine. I am including a
> Microsoft pop-server and a 'unknown' although probably some form of
> *NIX server.
>
> I was also reciveing some MD5.pm error's although they seem be gone.
> I would appreciate any info, guidance or help anyone could provide.
> thank you.
>
> -mUs.
>
> <script>
> #!/usr/bin/perl -w
>
> use Mail::POP3Client;
> use strict;
> use warnings;
>
> my($pop,$usr,$passwd,$host,$i);
> $usr = 'me@me.com';
> $passwd = 'clear_text';
> $host = 'pop.me.com';
>
It worked for me just by changing the me@me.com to my username without the
domain?
Tested on Suse 8.1 Linux client connecting to RH (I think)Servers.
BTW: I didn't have any new mail :-) In Case You were Wondering.
Debug -->
>perl -w pop.pl
POP3 <- +OK QPOP (version 3.1.2) at server.net starting.
at pop.pl line 13
POP3 -> USER username
at pop.pl line 13
POP3 <- +OK Password required for username.
at pop.pl line 13
POP3 -> password
at pop.pl line 13
POP3 <- +OK username has 0 visible messages (0 hidden) in 0 octets.
at pop.pl line 13
POP3 -> STAT
at pop.pl line 13
POP3 <- +OK 0 0
at pop.pl line 13
POP3 -> QUIT
at pop.pl line 24
POP3 <- +OK Pop server at server.net signing off.
at pop.pl line 24
>Exit code: 0
------------------------------
Date: 16 Dec 2002 22:52:56 -0800
From: fumail@freeuk.com (qanda)
Subject: Re: OK, I give up - merge different fields from 2 files into 1.
Message-Id: <62b4710f.0212162252.70bb513d@posting.google.com>
First I would like to apologise, I am having absolute nightmares at
work doing 14 hour days trying to finish a beta (in C, still learning
perl and wouldn't scare customers with what I'm capable of at the
moment!) before christmas (I know its asking for trouble but I'm not
the manager - all I can do is tell senior management it's going to be
bad in the long run - but hey that's the modern software world; I
prefer quality to quantity myself). Tad, big apologies for stupid
typos; as always you've been fantastic, thanks again.
tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnavsmgb.fst.tadmc@magna.augustmail.com>...
> qanda <fumail@freeuk.com> wrote:
>
>
> > I've seen lots of ideas but not enough to make sense of it all.
>
>
> I see lots of specification below, but not enough to make sense of it all.
>
>
> > I have the following files.
> > filea:
> > a1,a2,A,a4,data_2,a6,1a
> > a1,a2,A,a4,data_1,a6,1a
> > a1,a2,A,a4,data_3,a6,1a
> > a1,a2,A,a4,data_3,a6,2a
> > a1,a2,A,a4,data_5,a6,1a
> >
> > fileb:
> > b1,b2,B,b4,data_3,b6,1b
> > b1,b2,B,b4,data_1,b6,1b
> > b1,b2,B,b4,data_2,b6,1b
> > b1,b2,B,b4,data_6,b6,1b
> > b1,b2,B,b4,data_4,b6,1b
> > b1,b2,B,b4,data_7,b6,1b
> > b1,b2,B,b4,data_7,b6,2b
> > b1,b2,B,b4,data_7,b6,3b
>
> > I want to end up with something like this:
> > matched file:
> > a1,b2,a4,data_2,a6
> > a1,b2,a4,data_1,a6
> > a1,b2,a4,data_3,a6
> > a1,b2,a4,data_5,a6
>
>
> How did data_5 end up matching?
Big mistake, data_5 should be unmatched as you say.
>
>
> > Matched on the 4th field
>
>
> Matched on the _5th_ field in filea/fileb, but put into the
> 4th field in matched?
Next mistake, you're right again.
>
>
> > (for this example, in reality I match on
> > several fields) consisting of fields 1,3
>
>
> field 3 in filea has "A"s in it but they are not in your "matched"
> data, you must have meant field 4 there...
Right again.
>
>
> > and 6 from filea, and 2,5
> > from fileb, don't mind where field4 comes from.
>
>
> 3 fields from filea, 2 fields from fileb, plus the "matched" field.
>
> That adds up to 6 fields, your "matched" data has 5 fields...
Sorry, bit messed up there, I was trying to give an example to show 2
files with possibly different numbers of fields being used to create a
third file consisting of some fields from both files. I think my
lesson for the year - certainly the last few weeks is to slow down -
I'm really looking forward to christmas vacaction!
>
>
> > unmatched file:
> > a1,a2,A,a4,data_3,a6,2a
> > a1,a2,A,a4,data_5,a6,1a
>
>
> data_5 both matched and didn't match?
Good point, data_5 should be unmatched.
>
> How come data_6 didn't make it into either list?
You lost me on that one Tad? There was only 1 data_6 field in fileb,
unless you meant data_7, in that case they would all be unmatched as
there would need to be a corresponding data_7 field in filea.
>
>
> > b1,b2,B,b4,data_7,b6,1b
> > b1,b2,B,b4,data_7,b6,2b
> > b1,b2,B,b4,data_7,b6,3b
>
> > I don't expect a working example as an answer
>
>
> Surprise!
>
> But you'll have to adjust it once you repair your messed up spec...
>
> Merry Christmas :-)
Wow - you're amazing, I'll print this out and study it - thank you so
much. If I don't bug you again before Christmas all I can say is this
...
Merry Christmas and Happy new year to you all!!!
>
> ----------------------------------------
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> open UNMATCH, '>unmatched.csv' or die "could not open 'unmatched.csv' $!";
> open MATCH, '>matched.csv' or die "could not open 'matched.csv' $!";
>
> my %a;
> open FILEA, 'filea' or die "could not open 'filea' $!";
> while ( <FILEA> ) {
> my @f = split /,/;
> my $key = $f[4];
> if ( exists $a{$key} )
> { print UNMATCH } # only match the first occurence
> else
> { $a{$key} = \@f }
> }
> close FILEA;
>
> open FILEB, 'fileb' or die "could not open 'fileb' $!";
> while ( <FILEB> ) {
> my @b = split /,/;
> my $key = $b[4];
> if ( exists $a{$key} ) {
> my $m = join ',', $a{$key}[0],
> $b[1],
> $a{$key}[3],
> $key,
> $a{$key}[5];
> print MATCH "$m\n";
> delete $a{$key};
> }
> else
> { print UNMATCH }
>
> }
> close FILEB;
>
> print UNMATCH join ',', @{$a{$_}} for keys %a;
>
> close MATCH;
> close UNMATCH;
> ----------------------------------------
>
> $ head *.csv
> ==> matched.csv <==
> a1,b2,a4,data_3,a6
> a1,b2,a4,data_1,a6
> a1,b2,a4,data_2,a6
>
> ==> unmatched.csv <==
> a1,a2,A,a4,data_3,a6,2a
> b1,b2,B,b4,data_6,b6,1b
> b1,b2,B,b4,data_4,b6,1b
> b1,b2,B,b4,data_7,b6,1b
> b1,b2,B,b4,data_7,b6,2b
> b1,b2,B,b4,data_7,b6,3b
> a1,a2,A,a4,data_5,a6,1a
------------------------------
Date: 17 Dec 2002 01:15:43 -0800
From: m.browning@plymouth.ac.uk (M Browning)
Subject: Re: PErl and CSS
Message-Id: <eddc4731.0212170115.28618de@posting.google.com>
toxicfungi@yahoo.com (ToxicFungi) wrote in message news:<a34dbdd.0212161859.75988a4f@posting.google.com>...
> Martien,
>
> jip. i know about that message board. thats the one i am trying to
> edit now. Where in that perl script do I add the CSS statement ? so
> that when it cretes html, it impliments the css, so that it matches
> the rest of my webpage.
>
> tnx
>
> Martien Verbruggen <mgjv@tradingpost.com.au> wrote in message news:<slrnavsj5j.865.mgjv@verbruggen.comdyn.com.au>...
> > On 16 Dec 2002 07:40:18 -0800,
> > ToxicFungi <toxicfungi@yahoo.com> wrote:
> > > Hi group,
> > >
> > > I am trying to setup a message board for a website. This uses a perl
> > > script. It is basically Matt's WWWBoard.
> >
> > Have a look at http://nms-cgi.sourceforge.net/ for a much better
> > alternative (Matt says so himself).
> >
> > > How can I modify the perl script to format any html code it spits out
> > > to use CSS?
> >
> > Include the stylesheet somewhere at the top of the HTML.
> >
In the example you cite you would have to modify line seven of
wwwboard.html to refer to your own stylesheet.
If you are ``vanilla perl/cgi'' you can say:
$cgi->start_html( -style => { -src=>'styles.css' } );
...if you like, or provide style classes and stuff like this:
$cgi->h1( { -class => 'big' }, 'Great Big Headline');
...or inline:
$cgi->h1( { -style => 'color: black; '},'Default Colour');
...if you import the :html3 methods.
MB
------------------------------
Date: 17 Dec 2002 01:08:01 -0800
From: m.browning@plymouth.ac.uk (M Browning)
Subject: Re: Perl preinstalled. bad @INC
Message-Id: <eddc4731.0212170108.4b1df34d@posting.google.com>
"William Hymen" <t18_pilot@hotmail.spam.com> wrote in message news:<4dxL9.944$1a1.92119@newsread2.prod.itd.earthlink.net>...
> Our machines at work have ActiveState perl
> preinstalled under c:\apps_pub\p0503\ <rest of the tree>
>
> The @INC will not see the libraries.
> How do I "manually" force perl to see the
> perl modules I need. For example, I need
> cwd.
>
You script will look in the present working directory anyway, otherwise:
use lib '/path/to/wherever';
MB
------------------------------
Date: 17 Dec 2002 09:09:15 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Perl preinstalled. bad @INC
Message-Id: <u9n0n52ero.fsf@wcl-l.bham.ac.uk>
"William Hymen" <t18_pilot@hotmail.spam.com> writes:
> Our machines at work have ActiveState perl
> preinstalled under c:\apps_pub\p0503\ <rest of the tree>
>
> The @INC will not see the libraries.
> How do I "manually" force perl to see the
> perl modules I need.
With ActiveState on Win32 You can set the default @INC in the
registry.
Details in the perlwin32 manual.
> For example, I need cwd.
Note, by default @INC already includes '.'.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 17 Dec 2002 10:39:58 -0000
From: "Richard S Beckett" <spikey-wan@bigfoot.com>
Subject: Re: Setting DOS buffer size.
Message-Id: <atmuv9$ocb$1@newshost.mot.com>
"Andrew Harton" <andrew_harton@agilent.com> wrote in message
news:1040041246.521221@cswreg.cos.agilent.com...
> Hi there,
>
> This should do what you want :
>
> use Win32::Console;
> my $BUFFER = new Win32::Console(STD_OUTPUT_HANDLE);
> $BUFFER->Size(80,100);
>
> Hope that helps.
>
> Andrew
Andrew! What a hero!!!
Thanks very much!
R.
------------------------------
Date: Tue, 17 Dec 2002 08:28:55 +0100
From: Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Subject: Re: Using a hash as a reference is deprecated
Message-Id: <newscache$84697h$n4l$1@news.emea.compuware.com>
Bart Lateur wrote (Monday 16 December 2002 16:48):
> Koos Pol wrote:
>
>> %msg->{...}
>>
>>should be
>>
>> $msg->{...}
>>
>>You can only dereference a thingy if that thingy is a reference. Makes
>>sense, doesn't it :-)
>
> If only you were correct. The correct equivalent syntax is
>
> $msg{...}
>
> as it's the hash %msg, not the scalar $msg that is being used. "%msg->"
> is quite equivalent to "(\%msg)->", which even works.
What an eyeopener, Bart. I concluded from the warning ("Using a hash as a
reference is deprecated") that a hash ref notation was found where the
variable was a hash while it should have been a hash ref. I jumped too
quickly to conclusions...
--
KP
------------------------------
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.
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 4274
***************************************