[23770] in Perl-Users-Digest
Perl-Users Digest, Issue: 5974 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 23 14:05:40 2003
Date: Tue, 23 Dec 2003 11: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)
Perl-Users Digest Tue, 23 Dec 2003 Volume: 10 Number: 5974
Today's topics:
\r disappear even in binary mode <noone@nowhere.com>
Re: Add Files to Zip File <mikeflan@earthlink.net>
Deleting and moving multi-dim array "columns" <joeminga@yahoo.com>
Re: Deleting and moving multi-dim array "columns" (Jay Tilton)
Re: Deleting and moving multi-dim array "columns" <uri@stemsystems.com>
Re: Deleting and moving multi-dim array "columns" <nobull@mail.com>
Re: Deleting and moving multi-dim array "columns" <joeminga@yahoo.com>
Re: Deleting and moving multi-dim array "columns" <uri@stemsystems.com>
Re: Deleting and moving multi-dim array "columns" <uri@stemsystems.com>
Re: Deleting and moving multi-dim array "columns" <pkent77tea@yahoo.com.tea>
Re: Escape $ in replace pattern: How to replace pattern (him1508)
Re: Escape $ in replace pattern: How to replace pattern (him1508)
Re: fork <uri@stemsystems.com>
Re: h2xs sample compile error <randy@theoryx5.uwinnipeg.ca>
Re: Idiom for array index that I'm foreach'ing over? <ddunham@redwood.taos.com>
newbie: Terminating while($line=<stdin>) on Windows <a_madhur@vsnl.net>
Re: Parsing File <jwillmore@remove.adelphia.net>
Re: PDF creation in Perl <jwillmore@remove.adelphia.net>
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <szinger@lanl.gov>
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <flavell@ph.gla.ac.uk>
Problem with table in the module HTML::TextToHtml (ThERiZla)
Running a New Process <fabio@anti-spam.inet.alpha.pl>
Re: Running a New Process <nobull@mail.com>
Re: Running a New Process <fabio@anti-spam.inet.alpha.pl>
Re: Running a New Process <nobull@mail.com>
Simple telnet-like access (John Deuf)
Re: Simple telnet-like access <vladimir@NoSpamPLZ.net>
Re: SWIG sample compile problem <randy@theoryx5.uwinnipeg.ca>
Using Set::Scalar with DF_File (Brian Halligan)
Re: Why cant I break here in Perl Debugger? <wksmith@optonline.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 23 Dec 2003 18:12:07 +0100
From: noone <noone@nowhere.com>
Subject: \r disappear even in binary mode
Message-Id: <pan.2003.12.23.17.12.07.10434@nowhere.com>
Hi,
I wrote the following perl script test.pl which generates another perl
script:
binmode(STDOUT);
print "binmode(STDOUT);print \'\r\n\';"
When I run the generated perl script, it only prints the \n:
$ perl test.pl | perl - | hexdump -c
0000000 \n
0000001
Is it a bug or a feature? How to avoid it?
I use perl v5.8.0 built for i386-linux-thread-multi.
Thanks,
David.
------------------------------
Date: Tue, 23 Dec 2003 17:36:26 GMT
From: Mike Flannigan <mikeflan@earthlink.net>
Subject: Re: Add Files to Zip File
Message-Id: <3FE87DDF.BA09980B@earthlink.net>
Well, I'm surprised. Perl actually takes longer than my
non-Perl way to zip up these files. Perl takes about
10.5 minutes, while the non-Perl way takes about
5-6 minutes. I'm doing about 40 zip files.
I still plan to use Perl for this, since it's more robust
and I like Perl :-)
Mike
------------------------------
Date: Tue, 23 Dec 2003 11:57:25 -0500
From: "Domenico Discepola" <joeminga@yahoo.com>
Subject: Deleting and moving multi-dim array "columns"
Message-Id: <zx_Fb.169789$PD3.5875467@nnrp1.uunet.ca>
Hello. Given a variable $delete_col, how can I "delete" an entire array
"column" and "move" the remaining columns to the left? E.g. how do I turn:
( ["a", "b", "c"], ["1", "2", "3"] ) into ( ["a", "c"], ["1", "3"] ) given
that the value of $delete_col = 1?
TIA
#########
#!perl
use strict;
use warnings;
my $delete_col = 1;
my @arr01 = ( ["a", "b", "c"], ["1", "2", "3"] );
my ( $row, $col ) = 0;
foreach ( @arr01 ) {
#Get # cols in array
my $tot_cols = ( $#{$arr01[$row]} );
for ($col=0;$col<=$tot_cols;$col++) {
#Printing just for an example
if ( $col == $tot_cols ) {
print "$arr01[${row}][${col}]" ;
} else {
print "$arr01[${row}][${col}]:" ;
}
}
print "\n";
$row++;
}
exit 0;
------------------------------
Date: Tue, 23 Dec 2003 17:12:59 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Deleting and moving multi-dim array "columns"
Message-Id: <3fe876e7.313172393@news.erols.com>
"Domenico Discepola" <joeminga@yahoo.com> wrote:
: Hello. Given a variable $delete_col, how can I "delete" an entire array
: "column" and "move" the remaining columns to the left? E.g. how do I turn:
: ( ["a", "b", "c"], ["1", "2", "3"] ) into ( ["a", "c"], ["1", "3"] ) given
: that the value of $delete_col = 1?
:
: TIA
:
: #########
: #!perl
: use strict;
: use warnings;
:
: my $delete_col = 1;
: my @arr01 = ( ["a", "b", "c"], ["1", "2", "3"] );
splice(@$_, $delete_col, 1) for @arr01;
: my ( $row, $col ) = 0;
: foreach ( @arr01 ) {
: #Get # cols in array
: my $tot_cols = ( $#{$arr01[$row]} );
: for ($col=0;$col<=$tot_cols;$col++) {
: #Printing just for an example
: if ( $col == $tot_cols ) {
: print "$arr01[${row}][${col}]" ;
: } else {
: print "$arr01[${row}][${col}]:" ;
: }
: }
: print "\n";
: $row++;
: }
A less clumsy way to print out your matrix:
print join(':', @$_), "\n" for @arr01;
------------------------------
Date: Tue, 23 Dec 2003 17:21:38 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Deleting and moving multi-dim array "columns"
Message-Id: <x74qvro3fi.fsf@mail.sysarch.com>
>>>>> "DD" == Domenico Discepola <joeminga@yahoo.com> writes:
> Hello. Given a variable $delete_col, how can I "delete" an entire array
> "column" and "move" the remaining columns to the left? E.g. how do I turn:
> ( ["a", "b", "c"], ["1", "2", "3"] ) into ( ["a", "c"], ["1", "3"] ) given
> that the value of $delete_col = 1?
perldoc -f splice
splice( @{$_}, $delete_col, 1 ) for @list_of_rows ;
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: 23 Dec 2003 17:45:21 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Deleting and moving multi-dim array "columns"
Message-Id: <u9smjbsa1a.fsf@wcl-l.bham.ac.uk>
Uri Guttman <uri@stemsystems.com> writes:
> >>>>> "DD" == Domenico Discepola <joeminga@yahoo.com> writes:
>
> > Hello. Given a variable $delete_col, how can I "delete" an entire array
> > "column" and "move" the remaining columns to the left? E.g. how do I turn:
> > ( ["a", "b", "c"], ["1", "2", "3"] ) into ( ["a", "c"], ["1", "3"] ) given
> > that the value of $delete_col = 1?
>
> perldoc -f splice
>
> splice( @{$_}, $delete_col, 1 ) for @list_of_rows ;
It should be noted that 4 of the puntuation marks above are included
by Uri because, presumably, he finds that they aid (human)
readability. As far as Perl is concerned they are redundant.
splice @$_, $delete_col, 1 for @list_of_rows;
Which you find more readable is a matter of taste.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 23 Dec 2003 12:55:21 -0500
From: "Domenico Discepola" <joeminga@yahoo.com>
Subject: Re: Deleting and moving multi-dim array "columns"
Message-Id: <Sn%Fb.169942$PD3.5875623@nnrp1.uunet.ca>
"Jay Tilton" <tiltonj@erols.com> wrote in message
news:3fe876e7.313172393@news.erols.com...
> "Domenico Discepola" <joeminga@yahoo.com> wrote:
>
> : Hello. Given a variable $delete_col, how can I "delete" an entire array
> : "column" and "move" the remaining columns to the left? E.g. how do I
turn:
> : ( ["a", "b", "c"], ["1", "2", "3"] ) into ( ["a", "c"], ["1", "3"] )
given
> : that the value of $delete_col = 1?
Thanks for your replies - it's always nice to know that my ~20 lines of code
can be reduced down to 4 ;-) That one liner ( print join(':', @$_), "\n"
for @arr01; ) will certainly come in handy...
Dom
------------------------------
Date: Tue, 23 Dec 2003 18:06:16 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Deleting and moving multi-dim array "columns"
Message-Id: <x7smjbmmsn.fsf@mail.sysarch.com>
>>>>> "BM" == Brian McCauley <nobull@mail.com> writes:
> Uri Guttman <uri@stemsystems.com> writes:
>> splice( @{$_}, $delete_col, 1 ) for @list_of_rows ;
> It should be noted that 4 of the puntuation marks above are included
> by Uri because, presumably, he finds that they aid (human)
> readability. As far as Perl is concerned they are redundant.
you betcha your ass it is more readable! :)
> splice @$_, $delete_col, 1 for @list_of_rows;
> Which you find more readable is a matter of taste.
and mine is correct as are all of my opinions! :)
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Tue, 23 Dec 2003 18:12:12 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Deleting and moving multi-dim array "columns"
Message-Id: <x7ptefmmir.fsf@mail.sysarch.com>
>>>>> "DD" == Domenico Discepola <joeminga@yahoo.com> writes:
> "Jay Tilton" <tiltonj@erols.com> wrote in message
> news:3fe876e7.313172393@news.erols.com...
>> "Domenico Discepola" <joeminga@yahoo.com> wrote:
>>
>> : Hello. Given a variable $delete_col, how can I "delete" an entire array
>> : "column" and "move" the remaining columns to the left? E.g. how do I
> turn:
>> : ( ["a", "b", "c"], ["1", "2", "3"] ) into ( ["a", "c"], ["1", "3"] )
> given
>> : that the value of $delete_col = 1?
> Thanks for your replies - it's always nice to know that my ~20 lines of code
> can be reduced down to 4 ;-) That one liner ( print join(':', @$_), "\n"
> for @arr01; ) will certainly come in handy...
local $" = ':' ;
print map "@{$_}\n", @arr01 ;
i actually don't use $" anywhere but that is a decent idiom to know.
also a rule i have is "print rarely, print late".
print is very slow so it is better to call it as rarely as
possible. build up your strings or arrays of strings and print them all
at once. the for version calls print over and over.
print late means that you shouldn't print as soon as you have data. in
many case you may want to control where and when stuff gets printed. if
you have lots of print statements that is annoying to manage. so again,
build up the text in a scalar or array and print at the end. if it is in
a sub, i like to return the data to be printed and let the caller decide
what to do with it. it could be printed to the screen and logged and
whatever and that logic should be in the called in most cases.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Tue, 23 Dec 2003 18:52:25 +0000
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Deleting and moving multi-dim array "columns"
Message-Id: <pkent77tea-69EF3D.18522523122003@ptb-nnrpp01.plus.net>
In article <u9smjbsa1a.fsf@wcl-l.bham.ac.uk>,
Brian McCauley <nobull@mail.com> wrote:
> Uri Guttman <uri@stemsystems.com> writes:
...
> > perldoc -f splice
> >
> > splice( @{$_}, $delete_col, 1 ) for @list_of_rows ;
>
> It should be noted that 4 of the puntuation marks above are included
> by Uri because, presumably, he finds that they aid (human)
> readability. As far as Perl is concerned they are redundant.
>
> splice @$_, $delete_col, 1 for @list_of_rows;
>
> Which you find more readable is a matter of taste.
IMHO the example above isn't so hard to read anyway because it's just a
splice() with the 'for' statement modifier, so it's pretty clear-cut...
but some code isn't as clear.
As my job, like many people here, involves working with other people's
code, if something makes no real difference to perl but helps some
people understand my code better by making parts of it explicit and not
requiring them to even think (and thereby run the risk of thinking the
wrong thing), I'll write the one that helps out people. I care about
people. The machine will, as you say, interpret it the same.
P // working with old, badly commented, hard to read code for money!
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: 23 Dec 2003 07:38:11 -0800
From: himanshu.deshpande@contractor.thomson.com (him1508)
Subject: Re: Escape $ in replace pattern: How to replace pattern "a*c" by exact string "p$1q"
Message-Id: <dd6b6779.0312230738.64a555d3@posting.google.com>
Sorry guys, Tad, you are right. I meant a(.*)c. I'm actually
converting from a*c to a(.*)c in the process.
So to be clear, the problem statement is
> > search pattern : a(.*)c
> > replace string (not pattern, exact string): pqr$1xyz
> >
> > Search in : jkhjha8ctwe
> > Expected result: jkhjhpqr$1xyztwe
Regards,
Him
tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnbuekuf.4lj.tadmc@magna.augustmail.com>...
> him1508 <himanshu.deshpande@contractor.thomson.com> wrote:
>
> > search pattern : a*c
> > replace string (not pattern, exact string): pqr$1xyz
> >
> > Search in : jkhjha8ctwe
> > Expected result: jkhjhpqr$1xyztwe
>
>
> No, the expected result is: jkhjha8pqr$1xyztwe
>
> Did you mean to use a.*c for the pattern instead?
------------------------------
Date: 23 Dec 2003 10:26:27 -0800
From: himanshu.deshpande@contractor.thomson.com (him1508)
Subject: Re: Escape $ in replace pattern: How to replace pattern "a*c" by exact string "p$1q"
Message-Id: <dd6b6779.0312231026.5485bfe8@posting.google.com>
Hi,
Thank you for your reply. I hope this will further clarify the matter.
> >search pattern : a(.*)c
> >replace string (not pattern, exact string): pqr$1xyz
> >
> >Search in : jkhjha8ctwe
> >Expected result: jkhjhpqr$1xyztwe
> >Actual result : jkhjhpqr8xyztwe
The ORO package is just a java wrapper on perl. Actually it runs a
perl operation. The thing is I can specify only the search and replace
patterns, which in perl are as given below
/s/searchPattern/replacePattern/g
A working example can be
The working examples can be
> > search pattern : a(.*)c
> > replace string (not pattern, exact string): pqr$xyz
> >
> > Search in : jkhjha8ctwe
> > Expected result: jkhjhpqr$xyztwe
Here it works because there is no '1' after the dollar sign.
Regards,
Him
"Ragnar Hafstaš" <gnari@simnet.is> wrote in message news:<bs7pju$ufp$1@news.simnet.is>...
> "him1508" <himanshu.deshpande@contractor.thomson.com> wrote in message
> news:dd6b6779.0312220823.586304fb@posting.google.com...
> > Hi,
> >
> > I'm a novice to perl. For search and replace of strings, I'm using the
> > jakarta ORO Regex package which uses Perl5 internally. I need to build
> > a perl pattern for the search string and replace string. It is working
> > fine for all cases except this:
> >
> > search pattern : a*c
> > replace string (not pattern, exact string): pqr$1xyz
> >
> > Search in : jkhjha8ctwe
> > Expected result: jkhjhpqr$1xyztwe
> >
> you may be aware that this is not a pure perl s/// substitution,
> so unless someone here is familiar with the package, your info is not enough
> for us to help you with.
> in particular, it might be enlightening to see example of cases that 'work
> fine'
> and how they differ from the ones that do not.
> also, you give us the expected result but not the actual result.
>
> (I am assuming here that another similar substitution did actually
> work in the manner you described. if on the other hand real perl
> substitutions
> are supposed to work, you could try the pattern a(.*)c
>
> gnari
------------------------------
Date: Tue, 23 Dec 2003 16:10:47 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: fork
Message-Id: <x7smjbo6pl.fsf@mail.sysarch.com>
read perlfork
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Tue, 23 Dec 2003 08:48:55 -0600
From: "Randy Kobes" <randy@theoryx5.uwinnipeg.ca>
Subject: Re: h2xs sample compile error
Message-Id: <xBYFb.13462$Tb7.20377@news1.mts.net>
"Alex" <NOaehlkeSPAM@greendragonsoftware.com> wrote in message
news:3fe30e50$0$4752$61fed72c@news.rcn.com...
> I'm trying to compile the first example from the perlxstut. I've redone
the
> steps a few times to make sure I'm following them properly but I keep
> getting this problem when after trying to run make:
>
> Makefile:773: *** missing separator. Stop.
>
> I'm using the latest Cygwin on WinXP with the latest GCC and a recent
> version of Perl. I've tried reading into this and read some very vague
> advice on what could fix this but I haven't found a definite solution that
> has worked for me. Any ideas? All the steps before the make works fine
from
> the tutorial.
Was your Perl also compiled with gcc of cygwin? The above error often
arises when you try using a 'make' program that isn't the same as that
which was used to build Perl (perl -V:make).
best regards,
randy kobes
------------------------------
Date: Tue, 23 Dec 2003 16:30:27 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: Idiom for array index that I'm foreach'ing over?
Message-Id: <D4_Fb.1351$rx4.152@newssvr27.news.prodigy.com>
Eric J. Roode <REMOVEsdnCAPS@comcast.net> wrote:
> Alas, very slim. :-( I have this nagging feeling that version 6 is
> going to be the worst thing that ever happened to Perl.
New Coke?
--
Darren Dunham ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
------------------------------
Date: Tue, 23 Dec 2003 23:51:02 +0530
From: "Madhur" <a_madhur@vsnl.net>
Subject: newbie: Terminating while($line=<stdin>) on Windows
Message-Id: <bsa11g$b8aej$1@ID-81175.news.uni-berlin.de>
Hello
while($line==<stdin>)
{
}
How would this be terminated. It is terminated by ^D on Unix system I
think.
But on windows It doesnt work.
--
Winners dont do different things, they do things differently.
Madhur Ahuja
India
email : madhur<underscore>ahuja<at>yahoo<dot>com
------------------------------
Date: Tue, 23 Dec 2003 15:46:58 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Parsing File
Message-Id: <20031223104658.0426d8ff.jwillmore@remove.adelphia.net>
On Mon, 22 Dec 2003 14:30:30 -0600
tadmc@augustmail.com (Tad McClellan) wrote:
> James Willmore <jwillmore@remove.adelphia.net> wrote:
>
> > You *really* mean
> >
> > my $filename = '/path/name_of_file';
> > open F, "$filename" or die "Can't open $filename: $!\n";
> ^ ^
> ^ ^
> > right?
>
>
> Not right, because it has a useless use of double quotes.
>
> :-)
Opps! Sorry :-(
I don't know where my mind was ... I have no excuse :-(
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
"I couldn't remember when I had been so disappointed. Except
perhaps the time I found out that M&Ms really *do* melt in your
hand ..." -- Peter Oakley
------------------------------
Date: Tue, 23 Dec 2003 15:27:40 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: PDF creation in Perl
Message-Id: <20031223102740.35fbba62.jwillmore@remove.adelphia.net>
On Tue, 23 Dec 2003 14:43:46 +0100
Carsten Aulbert <carsten@welcomes-you.com> wrote:
> Iain wrote:
> > Any recommendations, anyone?
> wget -O- http://cpan.org/modules/01modules.index.html
> 2>/dev/null|grep -i pdf
Or, more idiomatic Perl ....
perl -MCPAN \
-e 'for $m(CPAN::Shell->expand("Module", "/pdf/")) {\
print $m->id,"\n";}'
(could be all on one line - but wanted to split the lines, so it's
more readable in the newsreader :-) ).
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
As the poet said, "Only God can make a tree" -- probably because
it's so hard to figure out how to get the bark on. -- Woody
Allen
------------------------------
Date: Tue, 23 Dec 2003 10:20:54 -0700
From: James Szinger <szinger@lanl.gov>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.4 $)
Message-Id: <giy8t3o3gp.fsf@cytotoxic.lanl.gov>
tadmc@augustmail.com writes:
> Intersperse your comments *following* each section of quoted text to
> which they relate. Unappreciated followup styles are referred to as
...
> "TOFU".
TOFU? I think the acronym needs expansion.
--
James J. Szinger Los Alamos National Laboratory
szinger@lanl.gov Theoretical Biology & Biophysics (T-10)
------------------------------
Date: Tue, 23 Dec 2003 18:14:51 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.4 $)
Message-Id: <Pine.LNX.4.53.0312231812540.30950@ppepc56.ph.gla.ac.uk>
On Tue, 23 Dec 2003, James Szinger wrote:
> TOFU? I think the acronym needs expansion.
http://www.google.com/search?q=jargon+tofu
Use the web, Luke...
------------------------------
Date: 23 Dec 2003 08:50:13 -0800
From: cool_ian10@hotmail.com (ThERiZla)
Subject: Problem with table in the module HTML::TextToHtml
Message-Id: <42f55bd6.0312230850.52abe1a9@posting.google.com>
Hi,
I want convert a text file to html file and I have proble with the
tables.
The module create a table in the html file but I can't have the border
of the table.
This is my code to call the module:
use HTML::TextToHTML;
my $inputFile = "test3.txt";
my $outputFile = "test3.html";
# create a new object
my $conv = new HTML::TextToHTML(titlefirst=>1, make_tables=>1,
table_type=>{ALIGN=>0, PGSQL=>0, BORDER=>1, DELIM=>0 },
tab_width=>20);
# convert a file
$conv->txt2html(infile=>[$inputFile],
outfile=>$outputFile);
I have four differents tables in my html file but none have border.
Someone can help me on this one ?
Thanks
------------------------------
Date: Tue, 23 Dec 2003 16:56:01 +0100
From: Fabio <fabio@anti-spam.inet.alpha.pl>
Subject: Running a New Process
Message-Id: <bs9ob5$5so$2@atlantis.news.tpi.pl>
Hello,
there's something I'd like to understand...
I want to connect to the MS SQL Server database, get some records, store
them into the text file, send the file through VPN connection and then
send the email message about the task success or failure.
First steps are quite easy but using the VPN connection makes me feel
powerless... How can I start the VPN client from the Perl script?
My script looks like that:
# some lines of code
`sh /etc/init.d/vpnclient_init start` || die "vpn init: $!\n";
system("vpnclient connect default user xxx pwd xxx");
system("smbmount //192.168.0.1/xxx /mnt/xxx -o username=xxx,password=xxx");
When I run the script it gets the data from SQL Server, creates the text
file and prints out the following text:
# Cisco Systems VPN Client Version 4.0.3 (B)
# Copyright (C) 1998-2003 Cisco Systems, Inc. All Rights Reserved.
# Client Type(s): Linux
# Running on: Linux 2.4.21-144-default #1 Fri Nov 14 00:01:36 UTC 2003 #
# i686
# WARNING:
# Using the "pwd" option may allow other users
# on this computer to see your password.
# Initializing the VPN connection.
# Contacting the gateway at XXX.XXX.XXX.XXX
# Authenticating user.
# Negotiating security policies.
# Securing communication channel.
# Your VPN connection is secure.
After printing this text my VPN connection is active and it works fine.
But the following Perl instructions aren't executed. I can use the VPN
connection from another console window but I don't want it to work that
way. All I want is executing the whole Perl script including the
instructions following the VPN connection initialization.
Thanks for any advice.
..:: fabio
------------------------------
Date: 23 Dec 2003 17:06:38 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Running a New Process
Message-Id: <u97k0ntqe9.fsf@wcl-l.bham.ac.uk>
Fabio <fabio@anti-spam.inet.alpha.pl> writes:
> My script looks like that:
>
> # some lines of code
>
> `sh /etc/init.d/vpnclient_init start` || die "vpn init: $!\n";
> system("vpnclient connect default user xxx pwd xxx");
> system("smbmount //192.168.0.1/xxx /mnt/xxx -o username=xxx,password=xxx");
>
> When I run the script it gets the data from SQL Server, text file
There is nothing in the script you have shown us that gets
data from an SQL Server or text file.
> and prints out the following text:
Your script doen't print any thing.
>
> # Cisco Systems VPN Client Version 4.0.3 (B)
[snip]
I suspect that's prnted by vpnclient.
> After printing this text my VPN connection is active and it works
> fine. But the following Perl instructions aren't executed.
How have you reached this conclusion?
Perhaps you should try a simple Perl instruction:
print "Reached line ", __LINE__, "\n";
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 23 Dec 2003 18:26:25 +0100
From: Fabio <fabio@anti-spam.inet.alpha.pl>
Subject: Re: Running a New Process
Message-Id: <bs9tn9$htp$1@nemesis.news.tpi.pl>
Brian McCauley wrote:
> There is nothing in the script you have shown us that gets
> data from an SQL Server or text file.
You're right. The script is too long to post it here.
> I suspect that's prnted by vpnclient.
Yes, that's printed by the vpnclient.
>>After printing this text my VPN connection is active and it works
>>fine. But the following Perl instructions aren't executed.
> How have you reached this conclusion?
Because I've checked whether the samba file share has been mounted or
not. It isn't mounted. This VPNClient behaves a little bit strange. If
you run it from the prompt is starts and prints some text on the screen.
But after printing the messages it doesn't return to the prompt. It's
possible to use it from another console window but I don't want to do
that. I want to run it from the Perl script and allow the other commands
to be executed after the VPN is initialized.
..:: fabio
------------------------------
Date: 23 Dec 2003 17:40:04 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Running a New Process
Message-Id: <u9y8t3saa3.fsf@wcl-l.bham.ac.uk>
Fabio <fabio@anti-spam.inet.alpha.pl> writes:
> This VPNClient behaves a little bit strange. If you run it from the
> prompt is starts and prints some text on the screen. But after
> printing the messages it doesn't return to the prompt.
There's probably some switch you can use to tell it to
fork-off-and-die once it's brought up the connection.
This of course has nothing to do with Perl.
If it doesn't then you want proabably Perl to start the vpnclient
process, wait for a specific message to be emitted then carry op to do
other stuff.
You'd do this lauching vpnclient using the pipe form of open().
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 23 Dec 2003 09:55:08 -0800
From: google@spongers.com (John Deuf)
Subject: Simple telnet-like access
Message-Id: <9760255.0312230955.5e6d4fd6@posting.google.com>
Hi,
I'd like to use a module in Perl to connect to a remote server through
a Telnet like connection.
Something allowing to
- wait for "login" word, then send the "login" name
- then wait for "password" then entering my password
- then doing a few I/O with the server (commands / answers)
I never used a tcp-ip module in Perl
- what is the best module to use
- how to simply implement the telnet connectivity
Thank you
Regards
gg
------------------------------
Date: Tue, 23 Dec 2003 18:52:38 GMT
From: lostriver <vladimir@NoSpamPLZ.net>
Subject: Re: Simple telnet-like access
Message-Id: <W90Gb.70356$NT6.1564206@weber.videotron.net>
On 23 Dec 2003 09:55:08 -0800, John Deuf wrote:
> Hi,
> I'd like to use a module in Perl to connect to a remote server through
> a Telnet like connection.
>
The best 'telnet like' connection is SSH. Use Net::SSH::Perl module to satisfy
your remote access needs.....
--
.signature: No such file or directory
------------------------------
Date: Tue, 23 Dec 2003 08:57:08 -0600
From: "Randy Kobes" <randy@theoryx5.uwinnipeg.ca>
Subject: Re: SWIG sample compile problem
Message-Id: <eJYFb.13473$Tb7.20484@news1.mts.net>
"Alex" <NOaehlkeSPAM@greendragonsoftware.com> wrote in message
news:3fe30d07$0$4736$61fed72c@news.rcn.com...
> I'm using Cygwin and ActiveState perl to try to compile a sample
> application using SWIG. I'm using the short tutorial from
> http://www.swig.org/tutorial.html (the perl part of it), but with a
> simplified version of their example (just a void hello()
> {printf("Hello, world!\n");} and corresponding .i interface file,
> %module hello \ extern void hello();).
>
> I first do swig -perl5 hello.i which works fine.
> Then I do:
> bash-2.05b$ gcc -c hello.c hello_wrap.c -I/cygdrive/c/perl/lib/core
>
> Which results in (because of hello_wrap.c, created by swig):
> In file included from /cygdrive/c/perl/lib/core/sys/socket.h:18,
> from /cygdrive/c/perl/lib/core/perl.h:722,
> from hello_wrap.c:291:
> /usr/include/w32api/winsock.h:81:2: warning: #warning "fd_set and
> associated macros have been defined in sys/types. This can cause runtime
> problems with W32 sockets"
[ ... ]
> I've got the latest cygwin, perl v5.6.1 built for
> MSWin32-x86-multi-thread build 633 from activestate, and the latest
> swigwin (swig for windows). I'm on WinXP.
This may be a problem with trying to use cygwin (gcc) in building
glue with a Perl (ActivePerl) that was compiled with VC++ . Even
if it succeeds, you may run into binary incompatibilities. If you want
to stick with ActivePerl, try using VC++, or if using VC++ is not
an option, try using a Perl compiled under cygwin.
best regards,
randy kobes
------------------------------
Date: 23 Dec 2003 10:04:45 -0800
From: halligan@mcw.edu (Brian Halligan)
Subject: Using Set::Scalar with DF_File
Message-Id: <1b3f172d.0312231004.55e81234@posting.google.com>
I would like to use DB_File to store and retrive a large number of
sets in a hash. I have been using Set::Scalar to create and compare
the sets, but I have been having trouble storing these sets using
DB_File. When I try to retrive the set based on a hash key, I get a
string that looks like the print version of the set. I would like it
to return a new set that I could then compare to others. Do I have to
'take apart' the print version and then recreate the set, or is there
a simple way to avoid this overhead and save and retrive the set
structure directly? Thanks.
Brian Halligan
Bioinformatics Research Center
Medical College of Wisconsin
------------------------------
Date: Tue, 23 Dec 2003 17:35:25 GMT
From: "Bill Smith" <wksmith@optonline.net>
Subject: Re: Why cant I break here in Perl Debugger?
Message-Id: <x1%Fb.381566$655.82018187@news4.srv.hcvlny.cv.net>
"Sara" <genericax@hotmail.com> wrote in message
news:776e0325.0312230539.3bb361a7@posting.google.com...
> I often want to break on the first line of a block, such as
>
>
> 21 while ($itsANiceDay)
> 22 {print "lets play outdoors\n";
> 23 $itsANiceDay = getWeatherReport();
> 24 }
>
>
> I can set a breakpoint on like 21 or 23, but why not 22? It looks like
> a legitimate place to break.
I have found the debugger to much more reliable on code that conforms to
all the conventions (and examples) in perldoc perlstyle. Your example
breaks as expected after it is rearranged into the following style:
21 while ($itsANiceDay){
22 print "lets play outdoors\n";
23 $itsANiceDay = getWeatherReport();
24 }
I do not know if this is a general rule, but I have always been able to
work around similar problems this way.
Bill
------------------------------
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 5974
***************************************