[19411] in Perl-Users-Digest
Perl-Users Digest, Issue: 1606 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 24 18:05:31 2001
Date: Fri, 24 Aug 2001 15:05:10 -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: <998690710-v10-i1606@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 24 Aug 2001 Volume: 10 Number: 1606
Today's topics:
Re: - HELP! Accidentally saved Perl script with WORDPAD <callgirl@la.znet.com>
Re: 4th ed of the Camel? <rob_13@excite.com>
Re: Check subroutine data from other process <ilya@martynov.org>
confused about 4 argument select <news@althepal#nospam#.com>
Re: D'oh! It does what I said, not what I want <lmoran@wtsg.com>
Re: Editor Question <stevea@wrq.com>
Re: Editor Question <gnarinn@hotmail.com>
Re: Flock This <rob_13@excite.com>
Re: Hashref to coderef? <djberge@uswest.com>
Re: Hashref to coderef? <krahnj@acm.org>
Re: Hashref to coderef? <mjcarman@home.com>
Re: help with searching for occurances of...... <gnarinn@hotmail.com>
How do I match and store || ??? <syrag@my-deja.com>
Re: How do I match and store || ??? <ilya@martynov.org>
Re: How do I match and store || ??? <syrag@my-deja.com>
How should perl exit when sent TERM? <bruce.g.mcardle_remove@intel.com>
localtime() - returns the wrong year! <Pcmann1@btinternet.com>
need help with regexp... (John Wentzcovitch)
Re: need help with regexp... <krahnj@acm.org>
Re: Perl rookie question! Setting up perl to work with <dbe@wgn.net>
Re: pl or not pl, that is the question <stevea@wrq.com>
Re: pl or not pl, that is the question <rob_13@excite.com>
Re: pl or not pl, that is the question <gnarinn@hotmail.com>
Print to multiple filehandles? tazjrg2
Re: Print to multiple filehandles? <ilya@martynov.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 24 Aug 2001 13:04:12 -0700
From: Kira <callgirl@la.znet.com>
Subject: Re: - HELP! Accidentally saved Perl script with WORDPAD...
Message-Id: <3B86B33C.C0EC0457@la.znet.com>
Jon 'The Mensch' wrote:
> Kira,
> You haven't been laid in a while, have you?
Your crass Neanderthaloid sexist remark is in well
keeping with your displayed relative intelligence.
Godzilla!
------------------------------
Date: Fri, 24 Aug 2001 19:06:03 GMT
From: "Rob - Rock13.com" <rob_13@excite.com>
Subject: Re: 4th ed of the Camel?
Message-Id: <Xns9107999C3BB32rock13com@64.8.1.227>
David Scarlett>
> Just wondering, since I unfortunately bought the 2nd ed of
> Learning Perl right before the 3rd ed came out, is there likely
> to be a 4th edition of the Camel any time in the near future?
> Perhaps with the release of Perl 6?
I haven't heard anything.
> I'm about to buy the Camel, and don't want to find out I missed
> out on the newest edition by a month. ;-)
LOL. I bought the 2nd camel shortly before the 3rd came out, so I
have them both dogeared and well used. You might check eBay before
buying new--if that is an option.
--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/
------------------------------
Date: 24 Aug 2001 22:09:17 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: Check subroutine data from other process
Message-Id: <87snehpbxu.fsf@abra.ru>
>>>>> On Fri, 24 Aug 2001 19:39:54 +0200, Mirek Rewak <cave@pertus.com.pl> said:
MR> Hi,
MR> At first: sorry for that stupid subject...
MR> How to solve this problem: I've got a subrountine which loops a long
MR> time (exactly Mail::Bulkmail::bulkmail) and I want check from other
MR> process status of this operation (counter, to check how many posts
MR> have been sent so far) while it is executing.
So you need InterProcess Communication (IPC). Read 'perldoc perlipc'.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Fri, 24 Aug 2001 20:21:03 GMT
From: Alex Hart <news@althepal#nospam#.com>
Subject: confused about 4 argument select
Message-Id: <PGyh7.33$A83.39607@typhoon1.gnilink.net>
I have read the doc on this, but there are things about the select(4
argument) that I don't get. I see in the doc to set it up like this:
$rin = $win = $ein = '';
vec($rin,fileno(STDIN),1) = 1;
vec($win,fileno(STDOUT),1) = 1;
$ein = $rin | $win;
or this:
sub fhbits {
my(@fhlist) = split(' ',$_[0]);
my($bits);
for (@fhlist) {
vec($bits,fileno($_),1) = 1;
}
$bits;
}
$rin = fhbits('STDIN TTY SOCK');
then this:
($nfound,$timeleft) =
select($rout=$rin, $wout=$win, $eout=$ein,
$timeout);
Can someone please explain the significance of the $rout=$rin part? What
does $rin look like . Can you tell me in english what is going on here.
Also, is this the only method of timing out a read? Will <> ever time
out, or is it forever?
It's all very appreciated. Thanks.
- Alex
------------------------------
Date: Fri, 24 Aug 2001 15:49:33 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: D'oh! It does what I said, not what I want
Message-Id: <tsbdot8tm7t6d2u900kse131n7k2d1coqj@4ax.com>
On 24 Aug 2001 17:07:10 GMT, "Christian Brink" <cb@onsitetech.com>
wrote wonderful things about sparkplugs:
ahhh! Thank you, I get it now.
SNIP
> # like this
> my $ping1 = `ping XXX.XXX.XXX.XXX -n 1` ;
> my $ping2 = `ping yahoo.com -n 25`;
> my $ping3 = `ping 132.163.4.101 -n 25` ;
> my $time = localtime() ;
> my $numb = 18501 ;
> #Also you do not need to interpret those backticks in a list format so
>get rid of the parens.
SNIP
------------------------------
Date: Fri, 24 Aug 2001 20:52:00 GMT
From: Steve Allan <stevea@wrq.com>
Subject: Re: Editor Question
Message-Id: <uu1yx41t5.fsf@wrq.com>
"Mark Riehl" <mark.riehl@agilecommunications.com> writes:
>All - Anyone using XEmacs? I'm running 21.4p3 on Win2k, and it is having
>fits with the indents on the following code. I can't seem to get it right,
>can't find a matching brace, etc.
>
>for $key (keys %RxTxData) {
> print RESULTS "Table key = $key\n";
>
> print RESULTS "My current info:\n";
> print RESULTS "Last SA: $RxTxData{$key}{last_sa_time}\t";
> print RESULTS "Last SA: $RxTxData{$key}{last_latitude}\t";
> print RESULTS "Last SA: $RxTxData{$key}{last_longitude}\n";
>
> print RESULTS "\nCurrent transmitters\n";
> foreach $key2 ( sort keys %{$RxTxData{$key}{my_display} } ) {
>
> if (${$RxTxData{$key}{my_display}{$key2}}[0] != 0) {
The best I can offer is to verify that it happens to me in the same
spot using xemacs 21.1 patch 9 on W2K. On the other hand, emacs 20.7
has no trouble with it. A quick kludge to format it and move on would
be to do this
if(0_ {
# if (${$RxTxData{$key}{my_display}{$key2}}[0] != 0) {
....
then highlight the whole block and do M-C-\ to autoindent it, then
replace the offending line.
You might also try asking in the xemacs group.
--
-- Steve __
------------------------------
Date: Fri, 24 Aug 2001 20:47:08 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: Editor Question
Message-Id: <998686028.740761307999492.gnarinn@hotmail.com>
In article <_Huh7.797$qq2.382426@typhoon1.gnilink.net>,
Mark Riehl <mark.riehl@agilecommunications.com> wrote:
>All - Anyone using XEmacs? I'm running 21.4p3 on Win2k, and it is having
>fits with the indents on the following code. I can't seem to get it right,
>can't find a matching brace, etc.
but that is because there your braces dont match, because braces
in strings are not matched. your real problem is that your quotes
do not match and you have what is call a runaway multi-line string.
> # print RESULTS "Accuracy:
>${$RxTxData{$key}{statistics}{$key2}}[1]\n";
^
a string starts here ------------------^
> }
> print RESULTS "\n";
^
and ends here --^
>Any suggestions? I've tried the XEmacs FAQ, and perl-mode on XEmacs.
i suggest you test your code with perl -wc
valid perl code is difficult enough for the auto-indenters to deal with
without expecting them to deal with incorrect code also
gnari
------------------------------
Date: Fri, 24 Aug 2001 18:56:41 GMT
From: "Rob - Rock13.com" <rob_13@excite.com>
Subject: Re: Flock This
Message-Id: <Xns910798056573Erock13com@64.8.1.227>
jtjohnston>
> Can someone show me how to do this better then?
What do you want to do better? If its a large file you could read
line by line rather than slurping in the whole thing, less memory
used.
> Here I'm just reading, but flicking to make sure I don't
> interfer with anyone writing at the same time.
>
> open(LOG,"$userlog") or die "can't open $userlog: $!\n";
> flock(LOG, 2);
> @STATData = <LOG>;
> close(LOG);
I load Fcntl so I don't have to remember a number 2. And actually
you probably want a 1 instead for a shared lock (LOCK_SH).
> Here I'm appending some data:
>
> open(LOG,">$userlog") or die "can't open $userlog: $!\n";
> flock(LOG, 2);
> print LOG @STATData;
> print LOG "\n$tempid$temp11$temp12$temp13$temp14$temp21";
> close(LOG);
>
'open(LOG,">$userlog")'
should be ">>$userlog" to append, you are doing a destructive open
that will clear the file. And the argument to flock would be, with
use Fcntl(:flock), LOCK_EX.
You may want to look at sysopen for other options on opening a
file. And if it means anything to you, you could check whether the
file actually got closed.
close(FH) or warn "Didn't close: $!";
--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/
------------------------------
Date: Fri, 24 Aug 2001 14:34:28 -0500
From: Mr Sunblade <djberge@uswest.com>
Subject: Re: Hashref to coderef?
Message-Id: <3B86AC44.201D4169@uswest.com>
Anno Siegel wrote:
> According to Mr Sunblade <djberge@uswest.com>:
>
> [snip]
>
> > sub sortArray{
> > my $ref = shift;
> > print "Ref is: ", ref($ref), "\n";
> > my @sorted = eval{ sort $ref @array };
>
> You don't need eval here.
>
> my @sorted = sort $ref @array;
>
> does the same thing.
Ok, I must be going insane. Maybe I was tired again - I tried this at
home on my Win2k machine running AS Perl and it simply *didn't work*. I
tried it without an eval, and it was as if it simply ignored the code
ref and sorted in alphabetical order no matter what the code ref was
that I passed to it. That's why I slapped it in here.
Can anyone out there running out there running Perl on Win2k check
this? I have it at home, but my cable modem is out again, so I was
trying to remember the code as I had it.
> > print "Sorted: ", join(',',@sorted),"\n";
> > }
>
> Your original question has been excellently answered.
>
> Anno
Not sure what that's supposed to mean, but I'm still curious how an
apparent hash ref ("sort {$a <=> $b} @array" vs "sort sub{$a <=> $b}
@array") is interpreted as a code ref.
Regards,
Mr. Sunblade
--
"Evil will always triumph because Good is *dumb*."
-- Dark Helmet, 'Spaceballs: The Movie'
------------------------------
Date: Fri, 24 Aug 2001 20:08:18 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Hashref to coderef?
Message-Id: <3B86B4A5.58D99F7F@acm.org>
Mr Sunblade wrote:
>
> Not sure what that's supposed to mean, but I'm still curious how an
> apparent hash ref ("sort {$a <=> $b} @array" vs "sort sub{$a <=> $b}
> @array") is interpreted as a code ref.
The first example is using a block of code not a hash reference. It's
the same as "sort {$a <=> $b;} @array" where the semicolon is optional.
perldoc -f sort
sort SUBNAME LIST
sort BLOCK LIST
^^^^^
sort LIST
John
--
use Perl;
program
fulfillment
------------------------------
Date: Fri, 24 Aug 2001 15:00:02 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Hashref to coderef?
Message-Id: <3B86B242.18D3FC9B@home.com>
Mr Sunblade wrote:
>
> Anno Siegel wrote:
> >
> > Your original question has been excellently answered.
>
> Not sure what that's supposed to mean,
I believe Anno was reffering to MJD's post. (Which may not have made it
to your newserver yet.)
> but I'm still curious how an apparent hash ref ("sort {$a <=> $b}
> @array" vs "sort sub{$a <=> $b} @array") is interpreted as a code
> ref.
Because it isn't a hash ref (even if it looks like one to you) and Perl
knows it. Perl is context sensitive; it knows what makes sense where. So
if you say:
my $hashref = {foo => 'bar'};
then the {} do indeed create an anonymous hash.
But for
print "It's ${fool}'s gold!\n";
they provide grouping. In
if ($x) {
# ...
}
they denote a block. Ditto for
my @sorted = sort {$a <=> $b} @array;
-mjc
------------------------------
Date: Fri, 24 Aug 2001 19:08:24 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: help with searching for occurances of......
Message-Id: <998680104.418959228787571.gnarinn@hotmail.com>
In article <n0mcot8rnntfhgrl8oadrar671d4rv3k62@4ax.com>,
Lou Moran <lmoran@wtsg.com> wrote:
>On 23 Aug 2001 18:38:17 GMT, trammell@haqq.hypersloth.invalid (John J.
>Trammell) wrote wonderful things about sparkplugs:
>
>>LINUX was released on August 25th, 1991
>>and is therefore a virgo.
>
(off-topic on conp.lang.perl.misc, so followups set)
does any one have the time and place?
Sun in Virgo:
Basically an industrious, precise and rational operating system.
Usually busy and on the move. A restless perfectionist who likes to
improve things.
Moon in Pisces:
Emotionally sensitive, dreamy and imaginative.
Likes his habits to be flexible and unpredictable.
Kind & compassionate yet moody.
Mercury in Leo:
An intuitive, idealistic and creative thinker.
Determined, proud and tenacious. "I know it all!" tendency.
Venus in Leo:
Lively, warm and expressive.
Likes his relationships to be entertaining and fun.
A creative lover.
Mars in Virgo:
A meticulous and skillful worker.
A craftsman who likes to improve and fix things.
An exact perfectionist.
Jupiter in Leo:
Noble and grand. Focusing on the entertainment industry,
as well as other creative activities, will
lead to personal growth and advancement.
Saturn in Aquarius:
Some of the biggest tests in his life come from dealing with people
in various groups and organizations, and establishing mental discipline.
Uranus in Capricorn:
Member of a generation that creates a revolution in government and
business practices.
Neptune in Capricorn:
Member of a generation that dreams of money, power and social status.
Pluto in Scorpio:
Member of a generation that transforms thinking regarding
sexual attitudes, intimate relationships and psychology.
Sun opposite Moon:
Conflict between ego/will and lifestyle/emotions.
Once he has achieved one goal he immediately seeks another.
Mercury conjunct Venus:
Communicates in a refined and polite manner.
Interested in analyzing relationships, beauty and love. An
artistic mind.
Venus conjunct Jupiter:
Positive emotions. Likes people who are lively and knowledgeable,
e.g. foreigners. Optimistic, friendly and popular.
Wants to have plenty of people around. Extravagant - "big spender".
Sun conjunct Venus:
Smooth, friendly, polite, charming. Interested
in beauty and the arts. A refined and appealing manner.
Mercury conjunct Jupiter:
A positive and active mind; optimistic.
A philosopher. Loves knowledge but may lack intellectual
discipline. A lively communicator. Tends to
exaggerate. Sees the "big picture".
------------------------------
Date: Fri, 24 Aug 2001 13:05:23 -0500
From: "Syrag" <syrag@my-deja.com>
Subject: How do I match and store || ???
Message-Id: <9m64v3$6bm$1@tilde.csc.ti.com>
I have been trying to match || with a regular expression but don't seem to
be having luck with this.
I want to match white space followed by some characters that might contain
|| (which I want to know about) followed by some other stuff that contains
xyz with a . after it.
I have tried several things to match the ||, but nothing seems to work. I
tried escaping each | with a \ (so \|), but that did not seem to work.
How do I match (and store) || ?
Here is what I am generally trying to do. Maybe I am taking the wrong
approach here.
elsif ( m/^\s*.*(||)?.*\s+(xyz)\s*\..*\r?$/i ) {
if ( $1 eq "||") {
printf("found || with xyz");
$pipes++;
}
else {
$pipes--;
}
}
Thanks in advance.
- Syrag
------------------------------
Date: 24 Aug 2001 22:21:33 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: How do I match and store || ???
Message-Id: <87elq1pbde.fsf@abra.ru>
>>>>> On Fri, 24 Aug 2001 13:05:23 -0500, "Syrag" <syrag@my-deja.com> said:
S> I have been trying to match || with a regular expression but don't seem to
S> be having luck with this.
S> I want to match white space followed by some characters that might contain
S> || (which I want to know about) followed by some other stuff that contains
S> xyz with a . after it.
S> I have tried several things to match the ||, but nothing seems to work. I
S> tried escaping each | with a \ (so \|), but that did not seem to work.
Escaping with \ should work. Something else is wrong in your regexp.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Fri, 24 Aug 2001 16:20:56 -0500
From: "Syrag" <syrag@my-deja.com>
Subject: Re: How do I match and store || ???
Message-Id: <9m6gdq$2ef$1@tilde.csc.ti.com>
I discovered that using (\|\|) matches and stores the ||, but using (\|\|)?
to match 0 or more does not work, it always matches (in the context of the
code below) and nothing is stored in $1.
- Gary
"Syrag" <syrag@my-deja.com> wrote in message
news:9m64v3$6bm$1@tilde.csc.ti.com...
> I have been trying to match || with a regular expression but don't seem to
> be having luck with this.
>
> I want to match white space followed by some characters that might contain
> || (which I want to know about) followed by some other stuff that contains
> xyz with a . after it.
>
> I have tried several things to match the ||, but nothing seems to work. I
> tried escaping each | with a \ (so \|), but that did not seem to work.
>
> How do I match (and store) || ?
>
> Here is what I am generally trying to do. Maybe I am taking the wrong
> approach here.
>
>
> elsif ( m/^\s*.*(||)?.*\s+(xyz)\s*\..*\r?$/i ) {
> if ( $1 eq "||") {
> printf("found || with xyz");
> $pipes++;
> }
> else {
> $pipes--;
> }
> }
>
> Thanks in advance.
>
> - Syrag
>
>
------------------------------
Date: Fri, 24 Aug 2001 16:23:31 -0400
From: "Bruce McArdle" <bruce.g.mcardle_remove@intel.com>
Subject: How should perl exit when sent TERM?
Message-Id: <9m6d44$h91@news.or.intel.com>
I have a strange problem. This code sometimes will seemingly keep executing
reaper forever if the perl script receives a kill -term:
It's almost always consistent with some people and other people it behaves
correct. Originaly I had die""; instead of exit(), and I thought that die
was recursively calling the reaper, but exit() does the same thing.
use POSIX ":sys_wait_h";
$SIG{TERM} = sub{reaper()};
$SIG{INT} = sub{reaper()};
$SIG{QUIT} = sub{reaper()};
fork_process ("sleep 60");
sub fork_process {
my $exec_line = $_[0];
# fork the sub process
if (!defined($kidpid = fork())) {
die "ERROR: cannot fork: $!";
} elsif ($kidpid == 0) {
# fork returned 0, so this branch is the child
$debug && print "starting $exec_line\n";
exec("$exec_line");
# if the exec fails, fall through to the next statement
die "ERROR: can't exec: $!";
} else {
# fork returned neither 0 nor undef, so this branch is the parent
waitpid $kidpid,0;
$kidpid = 0;
return $?;
}
} # sub fork_process
sub reaper{
# if our legitament child really is running
if ($kidpid) {kill 'TERM', $kidpid;}
print "received TERM signal\n";
exit();
} # sub reaper
------------------------------
Date: Fri, 24 Aug 2001 22:55:06 +0100
From: "Peter Mann" <Pcmann1@btinternet.com>
Subject: localtime() - returns the wrong year!
Message-Id: <9m6idn$p3s$1@neptunium.btinternet.com>
Dear All,
I have a small problem I can't work out! I need to retrieve the current
date and display it in 'short date' format. This is my code I have to try
and achieve this! The problem is that is displays
'24/07/101'
The day and month are correct, but 101 for the year isn't! Why wont is give
me back the correct year?
sub tasksBehind
{
my (undef, undef, undef, $day, $month, $year) = localtime();
print "$day/$month/$year";
}
Any suggestions would be much appreciated!
Thanks in advance
- Pete
------------------------------
Date: 24 Aug 2001 11:53:10 -0700
From: wentzcovitch@hotmail.com (John Wentzcovitch)
Subject: need help with regexp...
Message-Id: <405f748b.0108241053.28163580@posting.google.com>
I'm trying to use JGrasp (a nice multi-language free IDE found at
http://www.eng.auburn.edu/grasp/grasp_main.shtml ) with a compiler
that reports errors as:
*** ERROR 318 IN LINE 26 OF C:\TMP\TEST.C: can't open file 'graph.h'
In order to have JGrasp jump to the error location in the source file,
one has to specify an "error format" string that contains a perl5
regular expression associated with target flags.
I do not know Perl and was only able to discover that (F\ (.*?)\:)
finds the filename and (\d+) finds the line number on my error
message, but was not able to create an expression that would match
both filename and line number.
Any help is greatly appreciated.
John
JGrasp documentation about "error format":
The target flags are:
f= filename c= class 1= start line 2= start column 3= end line 4= end
column
For click-to-error to work, the numbers of target flags must be equal
to the number of matching groups in the regular expression. If a
filename or class is matched and the corresponding file exists, a
click will open the file. If the start line is matched, that line will
be highlighted. If the start and end lines and columns are matched,
that piece of text will be matched. If a filename and class are
matched, the filename will be tried first. If the same target type
matches multiple times, the last match is used. Unmatched groups are
ignored, so you can use or'ed expressions and repeated target flags to
match multiple possible formats.
As an example, "f1-(\S(?:\s*\S)*):(\d+):.*" will match the file
and line number of a GNU-style error message, as:
c:\tmp\test.c:22:error:stdio.h: No such file or directory
------------------------------
Date: Fri, 24 Aug 2001 19:08:18 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: need help with regexp...
Message-Id: <3B86A695.AB107825@acm.org>
John Wentzcovitch wrote:
>
> I'm trying to use JGrasp (a nice multi-language free IDE found at
> http://www.eng.auburn.edu/grasp/grasp_main.shtml ) with a compiler
> that reports errors as:
> *** ERROR 318 IN LINE 26 OF C:\TMP\TEST.C: can't open file 'graph.h'
>
> In order to have JGrasp jump to the error location in the source file,
> one has to specify an "error format" string that contains a perl5
> regular expression associated with target flags.
>
> I do not know Perl and was only able to discover that (F\ (.*?)\:)
> finds the filename and (\d+) finds the line number on my error
> message, but was not able to create an expression that would match
> both filename and line number.
(?i:LINE (\d+) OF ([A-Z]:[^:]+):)
John
--
use Perl;
program
fulfillment
------------------------------
Date: Fri, 24 Aug 2001 14:57:40 -0700
From: "$Bill Luebkert" <dbe@wgn.net>
Subject: Re: Perl rookie question! Setting up perl to work with IIS or Personal Web Server
Message-Id: <3B86CDD4.71066969@wgn.net>
S Warhurst wrote:
>
> "Tintin" <somewhere@in.paradise.net> wrote in message
> news:lNVg7.11$w01.56376@news.interact.net.au...
> > > The line: #!/usr/bin/perl is for unix.
> > >
> > > You need sth like: #!c:/perl/bin/perl.exe
> >
> > Rubbish! Don't answer questions that are off topic and don't give
> incorrect
> > answers.
>
> 1) "/usr/bin" is a unix style path.. and if I get the drive wrong in the
> "c:/perl/bin/perl.exe" path when switching between different NT machines
> with different perl locations my CGI throws up errors, so my answer was at
> least partly correct.
>
> 2) His post is about Perl.. maybe the cause of his problem is the enviroment
> Perl is running in, but he doesn't know that and he has to start somewhere
> to find out. It always amuses me about some newsgroups.. on the one hand you
> get some great selfless ppl who spend their valuable time helping solve
> other people's problems, and on the other there are people like you who seem
> to think it is their place to go round "policing" the newsgroup, and do so
> in the most unhelpful way possible. If you think it's off-topic then why are
> you reading it?
>
> 3) If you are going to accuse someone of being incorrect then at least have
> the decency to say "why" you think they are. I don't mind being corrected
> and welcome it as long as in doing so is decent about it. Similarly, if you
> accuse someone with a genuine query of being off-topic, then say why.
>
> 4) Don't tell me what to do.. you are nobody to me, so fuck you.
IIS and PWS don't use the shebang line - Apache does. #!perl is just as useful.
--
,-/- __ _ _ $Bill Luebkert ICQ=14439852
(_/ / ) // // DBE Collectibles Mailto:dbe@todbe.com
/ ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/
------------------------------
Date: Fri, 24 Aug 2001 18:51:41 GMT
From: Steve Allan <stevea@wrq.com>
Subject: Re: pl or not pl, that is the question
Message-Id: <u8zg9qogs.fsf@wrq.com>
ziegler@algorilla.de (Joachim Ziegler) writes:
>hi perlers,
>
>is it ok to call an ordinary perl-script 'helloworld.pl',
>or should it rather be call just 'helloworld'?
I use .pl on Windows because of the way Windows associates file
extensions. On Unix I don't, mainly because I don't want my
application to be tied to a particular language. I might write a
script in shell and later expand it's functionality using Perl, and
I'd like all of that to be transparent to the users.
>
>i remember having read that the 'pl' stands for 'perl library', but i
>can't find anything about this subject neither in the camel book, nor
>in the FAQ.
>
>greetings from germany,
>joachim
--
-- Steve __
------------------------------
Date: Fri, 24 Aug 2001 19:07:55 GMT
From: "Rob - Rock13.com" <rob_13@excite.com>
Subject: Re: pl or not pl, that is the question
Message-Id: <Xns910799ECB11AArock13com@64.8.1.227>
Ilya Martynov>
>>>>>> On 24 Aug 2001 03:01:10 -0700, ziegler@algorilla.de
>>>>>> (Joachim Ziegler) said:
>
> JZ> hi perlers,
> JZ> is it ok to call an ordinary perl-script 'helloworld.pl',
> JZ> or should it rather be call just 'helloworld'?
>
> JZ> i remember having read that the 'pl' stands for 'perl
> library', but i JZ> can't find anything about this subject
> neither in the camel book, nor JZ> in the FAQ.
>
> .pl as 'perl library' was valid in Perl 4 days. Nowdays people
> (including me) often use .pl for scripts. I think it is ok.
I do so as well, on Windows not having a .something is a pain.
Personal taste and the system you are working on.
--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/
------------------------------
Date: Fri, 24 Aug 2001 18:43:43 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: pl or not pl, that is the question
Message-Id: <998678623.426515280269086.gnarinn@hotmail.com>
In article <93aad7d0.0108240201.240f78b2@posting.google.com>,
Joachim Ziegler <ziegler@algorilla.de> wrote:
>hi perlers,
>
>is it ok to call an ordinary perl-script 'helloworld.pl',
>or should it rather be call just 'helloworld'?
>
>i remember having read that the 'pl' stands for 'perl library', but i
>can't find anything about this subject neither in the camel book, nor
>in the FAQ.
you can call them what you like.
on unix, the extention does not mean anything, except as a convenience
to humans. the shell uses the executable bits of the file permissions
along with the shebang line (#!/usr/local/bin/perl) to execute the script
for cgi scripts, i often use .html along with proper server
configuration or .htacess files
on Win, just make sure the extention you use is associated with the perl
binary, and you should be ok.
gnari
------------------------------
Date: 24 Aug 2001 13:37:09 -0500
From: tazjrg2
Subject: Print to multiple filehandles?
Message-Id: <5d7dotki2vk0c9339j5i2s22tttiqd18tp@4ax.com>
Is there any way to print to many filehandles from a single statement?
For example, instead of having these separate lines:
print LOGFILE "Server $servername\n";
print ERRFILE "Server $servername\n";
Can I combine those into one?
Thanks!
------------------------------
Date: 24 Aug 2001 23:09:26 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: Print to multiple filehandles?
Message-Id: <87vgjdnul5.fsf@abra.ru>
>>>>> On 24 Aug 2001 13:37:09 -0500, tazjrg2 said:
t> Is there any way to print to many filehandles from a single statement?
t> For example, instead of having these separate lines:
t> print LOGFILE "Server $servername\n";
t> print ERRFILE "Server $servername\n";
t> Can I combine those into one?
sub my_print(@) {
print LOGFILE @_;
print ERRFILE @_;
}
my_print "Server $servername\n";
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
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 1606
***************************************