[16532] in Perl-Users-Digest
Perl-Users Digest, Issue: 3944 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 8 00:05:26 2000
Date: Mon, 7 Aug 2000 21:05:11 -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: <965707511-v9-i3944@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 7 Aug 2000 Volume: 9 Number: 3944
Today's topics:
Re: Alternative to Format <nathan@nerdboy.com.au>
Re: combinations - a better way to do this? <tim@ipac.caltech.edu>
Converting from US dates/numbers to European dates/numb bluearchtop@my-deja.com
Re: date manipulation (Keith Calvert Ivey)
Re: find the number of characters in a string <godzilla@stomp.stomp.tokyo>
Re: find the number of characters in a string (Keith Calvert Ivey)
Re: Largest files <waltman@netaxs.com>
Re: Largest files <bwalton@rochester.rr.com>
Re: Mail::Mailer - multiple recipients? - Oops, found i antsyp@my-deja.com
Need explanation <rashid1218@hotmail.com>
Re: Need explanation <waltman@netaxs.com>
Re: Newbie: Regular Expression (Keith Calvert Ivey)
Novice question: How to kill a process satyapal_deja@my-deja.com
Re: Perl Newbie Question <research@ev1.net>
Re: problem with Mail::POP3 module pop3client@spam-free.dowds.net
Re: Problem with NT & Excel <jeff@vpservices.com>
Re: reg expression query <soszko@gmu.edu>
Re: reg expression query <troyr@vicnet.net.au>
Re: Retrieving data from dynamically created page paul5544@my-deja.com
Re: returning error message (Decklin Foster)
running a perl script from dos prompt <rashid1218@hotmail.com>
Re: script for getting modem to make internet connectio (David Efflandt)
Re: script for getting modem to make internet connectio <brentmi@bigpond.com>
What's use strict for?? <rashid1218@hotmail.com>
Re: What's use strict for?? (Andrew J. Perrin)
Re: What's use strict for?? <bwalton@rochester.rr.com>
Re: What's use strict for?? <waltman@netaxs.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 8 Aug 2000 14:03:11 +1000
From: "Inetcoop News Server" <nathan@nerdboy.com.au>
Subject: Re: Alternative to Format
Message-Id: <5ELj5.78337$N4.1987814@ozemail.com.au>
I did spot a few modules to create/manipulate pdf's (on CPAN...)
I haven't tried any of them, but I was actually planning to have a poke
about with them for a project starting in a month or so, seemed like a
reasonable idea.
Maybe if you get there first and try them, let me know how useful they are,
I'll do same.
Cheers,
NP
Stearns25 <stearns25@aol.com> wrote in message
news:20000714002520.07667.00001249@ng-ch1.aol.com...
> Hello all,
>
> We developed an intranet application using entirely Perl/DBI. Now we need
to
> generate reports from within the application. Although using
format/write
> of Perl gives the report layout we want, we can't do any formatting (e.g
bold,
> italic, changing font size, etc).
>
> Another than the 'format/write' and TeX/LaTex approach, is there other
> alternative? Is there any Perl module similar to the Crystal Report in
the VB
> world?
>
> Thanks for info and suggestions.
>
>
> -Stearns
>
>
------------------------------
Date: Mon, 07 Aug 2000 18:17:59 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: combinations - a better way to do this?
Message-Id: <398F5FC7.710CF5C8@ipac.caltech.edu>
"Chris W." wrote:
>
> This is the first time I've used Perl for anything where I care about
> speed and efficiency. I have a working piece of code, but would
> appreciate pointers to any performance improvements.
>
> The problem: I have a set of data on individuals and want to compare
> the result of performing an analysis with various members of the set
> missing. I want to use Perl to generate replicates of the data with
> different individuals' data missing. The analysis *will* be slow and so
> I want to run it as few times as possible. Within the set of
> individuals, some are 'equivalent' - ie running the analysis with one
> missing would be the same as running with the other missing, so I want
> to run only once. In the example below, individuals '0' and '1' are
> equivalent since $classes[0] = $classes[1], as are individuals '2', '3'
> and '4'.
I really can't go over your code in great detail, but one or two items
jump out at me:
- The 'element_of' sub can be replaced immediately with a lookup in a
hash. Hash lookups are very fast, cheap and easy. Read about them in
perldata and about more sophisticated data structures in perldsc.
- Read up on the 'slice' function (perlfunc) and on list and hash slices
(perldata); they could replace some of your loops.
- In general, the more you practise with perlish data structures and
expressions, the shorter, faster and easier to read your code will get.
More Perl, less C!
-- Tim
--
-- Tim Conrow tim@ipac.caltech.edu 626-395-8435
------------------------------
Date: Tue, 08 Aug 2000 03:43:52 GMT
From: bluearchtop@my-deja.com
Subject: Converting from US dates/numbers to European dates/numbers
Message-Id: <8mnvln$6mm$1@nnrp1.deja.com>
This is a dumb question, I'm sure, but anyway...
Let's say I have an simple script:
$a=1.23;
$b=2.00;
$c = $a + $b;
print $c;
This prints 3.23.
Now, let's say I have to run this on a computer in France, where 1.23
is actually 1,23.
1,23 + 2, would not work.
Other than converting back and forth, are there any other options?
Thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 08 Aug 2000 02:29:32 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: date manipulation
Message-Id: <39906b69.1035501@news.newsguy.com>
Larry Rosler <lr@hpl.hp.com> wrote:
>You are correct that the 5.6 FAQ has an explicit solution for this non-
>problem. But I don't recommend that, as it is pure pedantry or one-up-
>manship.
>
>I can't believe anyone would really care about the summer-time anomalies
>in the real world.
I don't understand why you think it's a nonproblem. Those two
hours a year when the nonpedantic solution doesn't work are
real, not merely theoretical, and the answers you get when you
run your program then will be *wrong* unless you take summer
time into account. We're not talking about leap seconds here.
Ignoring summer time seems to me to be the same sort of thinking
as ignoring the coming of 2000, except that it happens every
year.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Mon, 07 Aug 2000 18:36:23 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: find the number of characters in a string
Message-Id: <398F6417.AF2E4D25@stomp.stomp.tokyo>
Craig Berry wrote:
> Godzilla! wrote:
> : What method would you personally use to count letters?
> Given a string in $_:
> * To count the number of characters, I would use length.
> * To count the number of standard alphabet letters, I would use
> tr/A-Za-z//.
Very good! There is a safer way with tr although sometimes
this classic Hissy Bug shows up. Worth the risk though.
Apply one of those methods to the original question of
this thread; Bingo!
> To count the number of letter characters, respecting the
> current locale, I would use s/([^\W\d_])/$1/g in scalar context.
Would this work for Arabic and Eastern Bloc Cyrillic alphabet
along with Asian calligraphy?
I am being silly Mr. Berry. However this does remind me of an
incident during which numerous experts here took turns yelling
at me for addressing a transliteration question out of England
and not accounting for locale languages but rather an English
alphabet, although the question applied to England. Suppose it
isn't all that difficult, doesn't take a lot of smarts, to be
petty and grasp at straws to afford a chance at being hateful
or to massage a bruised testosterone laden ego.
Fortunately, I don't recall you being involved, Mr. Berry.
Still, I do recall where others so quickly forget. This is
a woman's preogative; having a memory.
Ain't I pernickety?
Godzilla!
------------------------------
Date: Tue, 08 Aug 2000 03:03:43 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: find the number of characters in a string
Message-Id: <399275c7.3689896@news.newsguy.com>
cberry@cinenet.net (Craig Berry) wrote:
>* To count the number of letter characters, respecting the current
> locale, I would use s/([^\W\d_])/$1/g in scalar context.
I think I'd use () = /[^\W\d_]/g in a scalar context.
Nondestructive s/// just seems weird. Avoiding the
substitution seems to be faster, too.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: 07 Aug 2000 22:59:22 -0400
From: Walt Mankowski <waltman@netaxs.com>
Subject: Re: Largest files
Message-Id: <m3wvhssbjp.fsf@netaxs.com>
tosh_v@my-deja.com writes:
> Hi,
>
> I have a huge dir structure with .wrp files and I need to get the 10
> biggest or 20 or any number I specify so that i can test my app to see
> ho wit handles the largest files.
>
> Any help on a perl script would be much appreciated.
Depending on your version of find, you might be able to do this from
the command line:
find . -printf "%s %p\n" | sort -n +0 -r | head
Walt
------------------------------
Date: Tue, 08 Aug 2000 03:15:09 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Largest files
Message-Id: <398F7B72.B3C4190@rochester.rr.com>
tosh_v@my-deja.com wrote:
...
> I have a huge dir structure with .wrp files and I need to get the 10
> biggest or 20 or any number I specify so that i can test my app to see
> ho wit handles the largest files.
...
> tosh
...
Do:
perldoc -f -s
to see what Perl's -s function will do for you. From there, it should
be straightforward to push the files sizes onto an array (perldoc -f
push), sort it numerically (perldoc -q sort, perldoc -f sort), and
output the top 10 or 20.
--
Bob Walton
------------------------------
Date: Tue, 08 Aug 2000 00:55:23 GMT
From: antsyp@my-deja.com
Subject: Re: Mail::Mailer - multiple recipients? - Oops, found it!
Message-Id: <8mnlpq$j$1@nnrp1.deja.com>
Of course, 2 minutes after I posted this, I found the error - the To
value needs to be a reference to an array.
In article <8mnl45$va3$1@nnrp1.deja.com>,
nancy@bigfishmail.com wrote:
> Using the Mail::Mailer module, I am able to send a mail using the
> following chunk of code (actually, I'm using 'test', so no mail gets
> sent):
> $mailer->open({ From => $From,
> To => ['a@a.com','b@b.com','c@c.com'],
> Subject => $Subject});
>
> However, when I change the To line to:
> To => @To,
> if only sends the message to the first recipient listed.
>
> @To is an array that has slurped in the To addresses from the
arguments
> to the script (@To = @ARGV, script named send_message, called
> with ./send_message a@a.com b@b.com c@c.com), it only sends mail to
the
> first recipient found in the @To array.
>
> Is there something missing here?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 08 Aug 2000 01:26:21 GMT
From: Rashid Saharudin <rashid1218@hotmail.com>
Subject: Need explanation
Message-Id: <8mnnjq$182$1@nnrp1.deja.com>
I have the code, but I don't know actually what it does. Could anyone
please explain to me.
use strict; => what is this for??
# ' substitutions after the while loop ends
while(<FILE>)
{
# append the line unless it's blank
$data .= $_ unless /^\s*$/;
}
$data =~ s/'[^']*'//g; =>> why is it outside the loop???
--
RASHID SAHARUDIN
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 07 Aug 2000 23:29:21 -0400
From: Walt Mankowski <waltman@netaxs.com>
Subject: Re: Need explanation
Message-Id: <m3r980sa5q.fsf@netaxs.com>
Rashid Saharudin <rashid1218@hotmail.com> writes:
> I have the code, but I don't know actually what it does. Could anyone
> please explain to me.
>
>
> use strict; => what is this for??
Among other things, it should require all variables to be declared
with my. See perldoc perldsc for more explanation.
>
> # ' substitutions after the while loop ends
> while(<FILE>)
Read through everything in the file pointed to by the filehandle FILE.
> {
> # append the line unless it's blank
> $data .= $_ unless /^\s*$/;
Append the line to $data unless it's all whitespace.
> }
>
> $data =~ s/'[^']*'//g; =>> why is it outside the loop???
It would work either way, but it's more efficient to do it at the
end.
Walt
------------------------------
Date: Tue, 08 Aug 2000 03:18:59 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Newbie: Regular Expression
Message-Id: <39937b4d.5104030@news.newsguy.com>
Ala Qumsieh <aqumsieh@hyperchip.com> wrote:
>Because tr/// does NOT take a regular expression.
>It takes a list of characters. So, your example is searching for
>occurrences of a backslash and an 's' (which is already included in
>a-z).
Not quite. The search string in tr/// doesn't interpolate
variables, but it does interpret backslash sequences (as
they're interpreted inside double-quoted strings, not
regular expressions), so
tr/\s//;
counts only "s"s, not backslashes.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Tue, 08 Aug 2000 02:04:07 GMT
From: satyapal_deja@my-deja.com
Subject: Novice question: How to kill a process
Message-Id: <8mnpql$2js$1@nnrp1.deja.com>
Perl is new to me.
I want the following shell statement to be executed from Perl.
kill -HUP `ps -eaf | grep named | cut -c 11-15`
(Baiscally I need to restart a named process)
Appreciate any help
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 08 Aug 2000 03:16:02 GMT
From: "Ken" <research@ev1.net>
Subject: Re: Perl Newbie Question
Message-Id: <SXKj5.3696$KO2.101395@typhoon.austin.rr.com>
First I would like to thank ya'll for the assistance, it's working now.
I do agree to move along in any language understanding the concepts are key.
I'm in my infancy in PERL and loving it, so I have no problem of grasping
the concepts, it's the trial and error that has frustrated me with the
reg-ex.
Again, thanks for the assistance!
"Larry Rosler" <lr@hpl.hp.com> wrote in message
news:MPG.13f89bcf2c0296e298ac3c@nntp.hpl.hp.com...
> [Choose a better Subject next time. Your question will have been
> filtered out by many newsreaders.]
>
> In article <na3j5.1750$KO2.37087@typhoon.austin.rr.com> on Sun, 06 Aug
> 2000 01:27:47 GMT, Ken <research@ev1.net> says...
> > I have a delimited file with data pertaining to each column. I am
needing
> > to add dates into every 4th column. I'm not grasping the concept of reg
> > exp, but the columns are delimited by |. The layout of the file is as
such.
> >
> > data0|data1|data2|data3|data4|data5|data6|data7|...data29
> >
> > The first date will need to be placed between data1 and data2, the next
date
> > is then placed between data5 and data6.
>
> Someone has posted a suggestion based on split, splice, and join. Here
> is a potentially faster, regex-based approach. If you want to advance
> beyond Perl Newbie, you must 'grasp the concept'. Read a web tutorial
> first, then `perldoc perlre`.
>
>
> #!/usr/bin/perl -wl
> use strict;
>
> my @dates = qw( D0 D1 D2 D3 D4 );
>
> $_ = 'd0|d1|d2|d3|d4|d5|d6|d7|d8|d9|d10|d11';
>
> my $i;
> s/([^|]+\|[^|]+\|)([^|]+\|[^|]+)/$1$dates[$i++]|$2/g;
>
> print;
>
>
> Isn't that regex an imposing sequence of line noise? More legibly:
>
> s/
> ( # Capture what follows in $1.
> [^|]+ \| [^|]+\ | # Non-| chars followed by |, twice.
> ) # End of capture in $1.
> ( # Capture what follows in $2.
> [^|]+ \| [^|]+ # Non-| chars separated by |.
> ) # End of capture in $2.
> /$1$dates[$i++]|$2/gx;
>
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
------------------------------
Date: Tue, 08 Aug 2000 02:32:35 GMT
From: pop3client@spam-free.dowds.net
Subject: Re: problem with Mail::POP3 module
Message-Id: <m3ya28wkho.fsf@c37191-A.mckiny1.tx.home.com>
>>>>> "Neil" == Neil Lathwood <laf@gameonline.co.uk> writes:
Neil> it connects fine, if I try it with a different mail server
Neil> (pop3.magicmail.co.uk) on the second example it says that it
Neil> can't connect to the server. I know that the usernames and
Neil> passwords are correct and that both mail servers are up and
Neil> running, Can someone shed some light on this problem?
Try adding AUTH_MODE=>'PASS' to the constructor. Also try running in
debug mode (DEBUG=>1 in the constructor). There are some instances
where a server that says it supports APOP can't because it does not
know your password (in cleartext).
------------------------------
Date: Mon, 07 Aug 2000 18:20:38 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Problem with NT & Excel
Message-Id: <398F6066.91A95E00@vpservices.com>
robert_linne_nelson@my-deja.com wrote:
> Ok, here's the error I'm getting from OLE:
>
> Win32::OLE(0.1101) error 0x80070005: "Access is denied" at
> D:\InetPub\intranet\intranet_2000\phonebook\search_dir.pl line 89.
>
> Does this have something to do with file permissions in NT?
Sure sounds like it. Check to make sure you don't have the same file
open with another application, or even with that same application.
--
Jeff
------------------------------
Date: Mon, 07 Aug 2000 22:05:37 -0400
From: Oszko & Malatinszky <soszko@gmu.edu>
Subject: Re: reg expression query
Message-Id: <398F6AF1.BAC82E10@gmu.edu>
Troy Rasiah wrote:
> Hi guys,
> I have $variable which contains the following text
> "events in Indonesia. Links to related sites LINKS links"
>
> I have $keyword="Links"
>
> $variable=~ s/$keyword/<b>$keyword<\/b>/g;
>
> Ok..that makes Links in variable bold when spat out in html. Is there a
> simple way for me to be able to look for LINKS or links as well?
Yes,
You would say
$variable=~ s/$keyword/<b>$keyword<\/b>/gi;
to make your substitution case-insensitive.
Isn't it neat how you ask a question on Tuesday morning and it gets answered
Monday night?
Andras
------------------------------
Date: Tue, 8 Aug 2000 12:40:38 +1000
From: "Troy Rasiah" <troyr@vicnet.net.au>
Subject: Re: reg expression query
Message-Id: <rsKj5.78215$N4.1986418@ozemail.com.au>
Thanks!!
Tuesday is lookin pretty good by the way heh
"Oszko & Malatinszky" <soszko@gmu.edu> wrote in message
news:398F6AF1.BAC82E10@gmu.edu...
> Troy Rasiah wrote:
>
> > Hi guys,
> > I have $variable which contains the following text
> > "events in Indonesia. Links to related sites LINKS links"
> >
> > I have $keyword="Links"
> >
> > $variable=~ s/$keyword/<b>$keyword<\/b>/g;
> >
> > Ok..that makes Links in variable bold when spat out in html. Is there a
> > simple way for me to be able to look for LINKS or links as well?
>
> Yes,
>
> You would say
>
> $variable=~ s/$keyword/<b>$keyword<\/b>/gi;
>
> to make your substitution case-insensitive.
>
> Isn't it neat how you ask a question on Tuesday morning and it gets
answered
> Monday night?
>
> Andras
>
------------------------------
Date: Tue, 08 Aug 2000 03:05:16 GMT
From: paul5544@my-deja.com
Subject: Re: Retrieving data from dynamically created page
Message-Id: <8mntda$541$1@nnrp1.deja.com>
Thank you very much for the feedback. I am still learning this language
and am finding (unlike other languages) there are many, many ways to do
the same thing..only better, faster and cleaner.
I will read up on the cgi.pm module.
I had thought of using different tags to identify each new line, but
how would I now how many lines were generated to grab the variables?
I am sure the answer is simple, but as I said above, I am still
learning. I try my best to find answers through all means possible
before I post as I don't want to clutter up the forum with stuff that
can be answered with a bit of effort and research.
Again, appreciate your assistance greatly!
In article <3998b3ad.64427660@news.newsguy.com>,
kcivey@cpcug.org (Keith Calvert Ivey) wrote:
> paul5544@my-deja.com wrote:
>
> >while (<EMAILFILE>)
> >{
> >$line = $_;
> >chop($line);
> >($currentemail, $currentuser_name, $status) = split (/\|/, $line);
>
> Some minor points: You're not using $_, so there's no point in
> having two copies of the line. (By the way, it's good that
> you're reading the file a line at a time rather than pointlessly
> reading it into an array and processing the array an element at
> a time.) Either use
>
> while (my $line = <EMAILFILE>) {
>
> and get rid of $_, or (more Perlishly) use $_ through and get
> rid of $line.
>
> >if ($currentemail ne "")
> >{
> > if ($currentemail eq "Do Not Remove This Line")
> > {
> > #Do Nothing, skip
> > }
> > else
> > {
>
> To avoid indenting your loop multiple times, you can change the
> above lines to
>
> next if $currentemail eq '' or
> $currentemail eq 'Do Not Remove This Line';
>
> Then put the end-of-loop print in a continue block.
>
> > print "<tr>\n";
> > print "<td>\n";
> > print " <p><select name=\"delete\" size=\"1\">\n";
> > print " <option value=\"no\">No</option>\n";
> > print " <option value=\"yes\">Yes</option>\n";
> > print " </select>Delete This Entry?</p>\n";
> > print "</td>\n";
> > print "<td>\n";
> > print "" . $currentemail . "\n";
> > print "<input type=\"hidden\" name=\"emailrecord\" value=\"" .
> >$currentemail . "\">\n";
> > print "</td>\n";
> > print "<td>\n";
> > print "" . $currentuser_name . "\n";
> > print "<input type=\"hidden\" name=\"userrecord\" value=\"" .
> >$currentuser_name . "\">\n";
> > print "<td>\n";
> > print " <p><select name=\"subscribe\" size=\"1\">\n";
>
> This would be much clearer with a here-document. You wouldn't
> have the multiple print()s or the backslashed double quotes.
>
> [snip]
>
> >This works great. It builds the page perfectly.
> >However, now I am trying to update the file it read from when the
user
> >changes something and clicks on the appropriate button.
> >I know how to get the values and assign them to a variable, the
problem
> >I am having is that each entry built is assigned the same field names
> >so when I parse the form, the variables are getting overwritten by
the
> >next set of values read from the page.
>
> Sounds like you're not using CGI.pm. The additional values
> would all be there if you were using CGI.pm. Of course, you
> still might have trouble telling which goes with which row, so
> you might want to use different names on each row (delete1,
> emailrecord1, userrecord1, subscribe1, delete2, emailrecord2,
> userrecord2, subscribe2, etc.).
>
> --
> Keith C. Ivey <kcivey@cpcug.org>
> Washington, DC
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 08 Aug 2000 02:48:16 GMT
From: decklin+usenet@red-bean.com (Decklin Foster)
Subject: Re: returning error message
Message-Id: <QxKj5.13448$f_5.67461@news1.rdc1.ct.home.com>
daemon <daemon@i.am.daemon> writes:
> I'm writting a module and need to be able to return an error string
> in the event of a problem. I can't just set $! because perl expects
> that to be a numeric value.
I'm not really sure what you want to do. You don't need to set $!
because
> unless (open (FILE, $file)) {
will set it when it fails. If you get an error, return something that
you and the caller have agreed upon to mean 'error' (0, -1, etc), and
make sure the caller understands that it is to look in $! upon
failure. This is how open works, and loosely how the *nix C library
works.
> --
> Citizens, elect Satan in 2000!
*mumble* I don't think they need much prodding... *mumble*
--
There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There
are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6)
------------------------------
Date: Tue, 08 Aug 2000 03:39:20 GMT
From: Rashid Saharudin <rashid1218@hotmail.com>
Subject: running a perl script from dos prompt
Message-Id: <8mnvd8$6jp$1@nnrp1.deja.com>
I got a perl script where I want to strip blank lines in a text file.
The perl file is "comments.pl" and the text file is "comments.txt".
If I run the perl script ie "perl comments.pl" it works in a dos
prompt. Is there anyway that if I type something similar beneath the
perl will work.
1. ".../comments.txt"
2. .../comments.txt"
3. path=c:\comments.txt
Could anyone help me please.
--
RASHID SAHARUDIN
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 8 Aug 2000 01:05:35 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: script for getting modem to make internet connection.
Message-Id: <slrn8oun6e.ej.efflandt@efflandt.xnet.com>
On Tue, 8 Aug 2000 09:49:46 +1000, Brent <brentmi@bigpond.com> wrote:
>Hi there I was wondering if anyone new if there was something in perl
>that could be used to talk to a modem and dial an internet connection.
>Is there a module or something I can call to start with?
>
>The result I'm looking for is something that can dial multiple POPs one
>after the other and once a connection is made I want to do some other
>stuff to check links, mail, ping times etc, log the events then
>disconnect and do the next.
What OS? In Linux it would be easy, but I would not know how to bring up
various connections in Windows.
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Tue, 8 Aug 2000 11:12:07 +1000
From: Brent <brentmi@bigpond.com>
Subject: Re: script for getting modem to make internet connection.
Message-Id: <MPG.13fa0976ba8aadcb989689@news.bigpond.com>
In article <slrn8oun6e.ej.efflandt@efflandt.xnet.com>, efflandt@xnet.com
says...
> On Tue, 8 Aug 2000 09:49:46 +1000, Brent <brentmi@bigpond.com> wrote:
> >Hi there I was wondering if anyone new if there was something in perl
> >that could be used to talk to a modem and dial an internet connection.
> >Is there a module or something I can call to start with?
> >
> >The result I'm looking for is something that can dial multiple POPs one
> >after the other and once a connection is made I want to do some other
> >stuff to check links, mail, ping times etc, log the events then
> >disconnect and do the next.
>
> What OS? In Linux it would be easy, but I would not know how to bring up
> various connections in Windows.
>
>
yes this would be under NT4.
------------------------------
Date: Tue, 08 Aug 2000 01:58:57 GMT
From: Rashid Saharudin <rashid1218@hotmail.com>
Subject: What's use strict for??
Message-Id: <8mnpgv$2gq$1@nnrp1.deja.com>
Could anyone tell me, what is 'use strict' for, please???
--
RASHID SAHARUDIN
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 07 Aug 2000 22:57:10 -0400
From: aperrin@demog.berkeley.edu (Andrew J. Perrin)
Subject: Re: What's use strict for??
Message-Id: <u1z00wjcp.fsf@demog.berkeley.edu>
Rashid Saharudin <rashid1218@hotmail.com> writes:
> Could anyone tell me, what is 'use strict' for, please???
Type:
perldoc strict
to find out.
--
----------------------------------------------------------------------
Andrew Perrin - Solaris-Linux-NT-Samba-Perl-Access-Postgres Consulting
aperrin@igc.apc.org - http://demog.berkeley.edu/~aperrin
----------------------------------------------------------------------
------------------------------
Date: Tue, 08 Aug 2000 03:08:25 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: What's use strict for??
Message-Id: <398F79DF.787EF232@rochester.rr.com>
Rashid Saharudin wrote:
>
> Could anyone tell me, what is 'use strict' for, please???
>
> --
> RASHID SAHARUDIN
...
The strict module doesn't actually *do* anything other then generate
error messages for Perl code that does not meet "strict" programming
standards, such as declaring all variables prior to use (and many
others). It is a good idea to use strict in Perl programs that are
somewhat more complicated or lengthy, or that may be used in a module in
the future. It is good at catching variable misspellings and catching
all sorts of subtle errors. It is highly recommended by most folks with
lots of experience in programming. And, of course, you will also want
to us the -w switch with your program as well. See:
perldoc strict
--
Bob Walton
------------------------------
Date: 07 Aug 2000 23:16:40 -0400
From: Walt Mankowski <waltman@netaxs.com>
Subject: Re: What's use strict for??
Message-Id: <m3u2cwsaqv.fsf@netaxs.com>
Rashid Saharudin <rashid1218@hotmail.com> writes:
> Could anyone tell me, what is 'use strict' for, please???
There's a good explanation in the perldsc manpage. Run
perldoc perldsc
and search for
WHY YOU SHOULD ALWAYS `use strict'
Walt
------------------------------
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 3944
**************************************