!
Hans
[bottom post order:]
On Thursday 30 March 2006 05:15 am, Hans Meier (John Doe) wrote:
tom arnall am Donnerstag, 30. März 2006 12.36:
the following code:
my (@main);
$_=
From a
From: b
From: c
From: d
;
@main = /From [^\n]*?\n.*?(From: .*?\n
tom arnall am Donnerstag, 30. März 2006 12.36:
the following code:
my (@main);
$_=
From a
From: b
From: c
From: d
;
@main = /From [^\n]*?\n.*?(From: .*?\n).*?/gx;
print @main;
print --\n;
Dave Adams am Donnerstag, 30. März 2006 21.12:
If I have a xml file like the following:
?xml version='1.0'?
employee
nameJohn Doe/name
age43/age
sexM/sex
departmentRecieving/department
/employee
employee
nameBob Gordon/name
age50/age
Gavin Bowlby am Donnerstag, 30. März 2006 21.45:
How about:
cat fn | grep string to be searched for | wc
When I posted a cat | grep the first (and last) time, several people got a
well known heart attack :-)
grep string to be searched for fn | wc
as a non-Perl approach to the problem...
Chas Owens am Donnerstag, 30. März 2006 22.35:
cat fn | grep string to be searched for | wc
[...]
grep string to be searched for fn | wc
[...]
If we are going to pick nits then it should be
grep -c employee fn
too much work.
c employee fn
But your alias may be different ;-)
Hans
--
Bob Showalter am Donnerstag, 30. März 2006 23.32:
Chas Owens wrote:
If we are going to pick nits then it should be
grep -c employee fn
Note that grep -c counts matching *lines*. There is no formal
requirement that these elements appear on separate lines.
Dave,
my first one-liner
John W. Krahn am Donnerstag, 9. März 2006 03.36:
Hans Meier (John Doe) wrote:
[...]
my @array;
#or:
my @array=();
[v--- this sidenote is wrong]
(sidenote: the second form must be used in contexts where the code is
persistent/preloaded and used several times, to ensure that @array
Practical Perl am Donnerstag, 9. März 2006 09.50:
Hello,
I have a script,which run well at most time.This day I use it to analyse
the files of 1.7G,it become very slow and can't get executed continuely
anymore.When I run 'strace -p ' (here is this script's PID),there
is no output,it
Adam W am Mittwoch, 8. März 2006 02.10:
Hans Meier (John Doe) wrote:
Adam W am Mittwoch, 8. März 2006 00.49:
Sorry, I'm relatively new to programming in general (perl is my first
programming language), so I'm not sure what you mean by sanitizing.
Could also be sanitising, saw both
Eugeny Altshuler am Mittwoch, 8. März 2006 11.35:
Hello!
I have such problem, I need to make multistring replacement... How can
I do this?
I tried to make perl script which acquires file form STDIN and prints
result into STDOUT
cat file.html | ./myscript
That's one way to pass the file
From: Graeme McLaren [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 08, 2006 3:57 PM
To: beginners@perl.org
Subject: counting scalar array elements question
Hi all, I have an array question:
If I have a variable, $var, and it contains an array how would I be able
to
easily
DiGregorio, Dave am Dienstag, 7. März 2006 19.30:
Ok, I am trying to run another perl script from a perl script and have
had little luck in doing so. The main script is in one directory and
the one it is controlling is in another directory. the main script
starts and calls the other script
Adam W am Dienstag, 7. März 2006 23.16:
Hans Meier (John Doe) wrote:
just to sum up:
$test =~ s{ (.*?) \( (.*?) \) }
{a href=$2 alt=$2$1/a}xsg;
- \( instead of [(]: more readable
- no /m modifier : unnecessary without ^/$-anchors
- /s : may
JupiterHost.Net am Mittwoch, 8. März 2006 00.29:
- \( instead of [(]: more readable
not according to best practices
Hi JupiterHost.Net
I think there are more than one best practices, although not several books
carrying this title. I can't - and don't want to - diskuss based on
According to
Adam W am Mittwoch, 8. März 2006 00.49:
Hans Meier (John Doe) wrote:
Adam W am Dienstag, 7. März 2006 23.16:
Hans Meier (John Doe) wrote:
[...]
(this dies on empty lines etc. too, and of course the input file's lines
should be sanitizes before, and to be on the secure side
Madhu Kumar am Montag, 6. März 2006 09.57:
Hi ,
Hi Madhu Kumar
your problem is not perl, but html related, see below:
I want to display database records as web page my database
contains some entries and which i wanna write as a report in web
page.
I have written a code for it which
John W. Krahn am Dienstag, 7. März 2006 00.12:
Adam W wrote:
JupiterHost.Net wrote:
$text =~ s!(.*?)\((.*?)\)!a href=$2 alt=$2$1/a!g;
[...]
Same exact regex as above:
$test =~ s{ (.*?) [(] (.*?) [)] }
{a href=$2 alt=$2$1/a}xmsg;
[...]
Can you tell me what the
Angus am Freitag, 3. März 2006 17.40:
Yes, I did have that typo in my script. I fixed it but I am still never
seeing anything print out that says I have a match as the first if
control should do.
Have you ensured that the compared data structures meet the conditions for a
match? The
regatta am Freitag, 3. März 2006 21.29:
Good morning/evening everyone,
I have a hash of data , this hash is very big with dynamic elements
(strings, numbers, hashes, arrays)
Here is an example
$info{'system'}{'load'}{'1'}
$info{'system'}{'load'}{'5'}
$info{'system'}{'load'}{'15'}
Angus am Montag, 27. Februar 2006 08.25:
Hi all,
I am having some problems filling a variable based on the contents of a
dhcpd.leases file. All I want at this time is the hostname and ip address.
My eventual goal is to create hash of hashes with this information but for
now I just want to
Bob Showalter am Samstag, 25. Februar 2006 15.03:
henry chen wrote:
I can't seem to figure out how to alternate the bgcolor for each row
that i'm printing from arrayref. Is there a 'foreveryother' function
that would allow me to put two lines in the loop? Or is there someway I
can put
henry chen am Samstag, 25. Februar 2006 07.07:
I can't seem to figure out how to alternate the bgcolor for each row that
i'm printing from arrayref. Is there a 'foreveryother' function that would
allow me to put two lines in the loop? Or is there someway I can put two
rows of information and
Bryan R Harris am Donnerstag, 23. Februar 2006 19.30:
Responding to your references to modules, we haven't used them because we
can't count on them being there. Obviously my problem, not yours. =)
[...]
There is no must to have them installed in default locations. You can install
them in any
Irfan J Sayed am Freitag, 24. Februar 2006 16.36:
Hi All,
I need to execute unix tar command thru perl file
can somebody helps me out in this regard
http://search.cpan.org/~kane/Archive-Tar-1.28/lib/Archive/Tar.pm
hth
Hans
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
Irfan J Sayed am Freitag, 24. Februar 2006 19.13:
Hi ,
I already tested with /vobstg.tar in the gzip command but still it's
hanging and i am executing this perl script from / partition only.
Main thing is that it's creating /vobstg.tar.gz file but not coming to
shell prompt or not executing
Chas Owens am Samstag, 25. Februar 2006 07.17:
[...]
Use the module operator (%) with an if statement to do different
things in a loop:
my $rows = $dbhandle-selectall_arrayref($sql) || die $dbhandle-errstr;
if (@$rows) {
print centertable border=1 cellspacing=0 cellpadding=3
Chas Owens am Samstag, 25. Februar 2006 08.18:
[...]
Aye, I am an idiot.
No, your help on this list is very valuable, and, imho, typos are not proof
for idiocy...
Hans
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Jack Daniels (Butch) am Donnerstag, 23. Februar 2006 10.30:
It's driving me bonkers and can't afford any more psychiatic bills. The
data is a saved .txt file when viewing from a website. The vendor will not
give us an actual file even though we payed a montly fee for use of the
database. I
Hans Meier (John Doe) am Donnerstag, 23. Februar 2006 13.07:
[...]
sorry for replying to myself...
The script is only extracting the first line of the heading..
Yes, with every loop trough @lines, you overwrite your variables $title to
$dewey.
this doesn't matter since you print the contents
Bryan Harris am Donnerstag, 23. Februar 2006 16.41:
Hi Bryan
It's a bit lengthy, but I hope it motivates you a bit to look around...
You mention larger projects, and I've heard about reusable code... Is
that generally done by copy/paste into the script you're working on?
Code copiedpasted
Angerstein am Mittwoch, 22. Februar 2006 11.05:
Short Question:
Is type globbing of subroutines possible or not?
yes,
perl -le 'use warnings; use strict; \
sub sub1{1}; \
*sub2=\sub1; \
warn sub2(); \
'
for something like supersub(\smallsub);
This (passing a subroutine reference as argument
zhou jian am Mittwoch, 22. Februar 2006 22.40:
Hello perl fellows:
Hi Paul
This is the wrong list for this question (see your subject) but:
I encountered a problem when I was installing a perl
module. The httpd server related module was hanging
overnight when it was trying to test
Johannes Ernst am Donnerstag, 23. Februar 2006 00.19:
[Blogged about it here: http://netmesh.info/jernst/Technical/perl-
inheritance-problem.html ]
There are three very simple classes in the following code: C is a
subclass of B, which is a subclass of A.
If I try to instantiate B (see last
Bryan Harris am Donnerstag, 23. Februar 2006 03.46:
Thanks!
Regarding your note, out of curiosity, how will it help a lot in the end?
I've been scripting for almost 5 years now, and have produced 100 scripts
that are used in data analysis work by ~15 people, and have never used use
strict,
Ron Smith am Sonntag, 19. Februar 2006 18.47:
Hi all,
Hi Ron
This page accepts a series of numbers, separated by spaces, and gives the
values listed bellow.
I'm getting the following error,
No information about the input that causes the error; are there also inputs
not causing an
Ron Smith am Sonntag, 19. Februar 2006 21.27:
I changed this too. Thanks, Hans!
[irrelevant parts snipped away]
The irrelevant was not quite true...
As always, John W. Krahn looked closer into the code, finds simpler solutions
and does not miss to point to the appropriate documentation - if
Owen Cook am Sonntag, 19. Februar 2006 22.21:
I suggest you use Matt Sergeant's DBD::SQLite a Self Contained RDBMS in a
DBI Driver.
It rocks
Owen, thanks a lot for this tip!!!
The aggregate function feature looks very promising
:-)
Hans
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Andrej Kastrin am Samstag, 18. Februar 2006 14.08:
Dear Perl users,
I try to parse 20.000.000 records file but... To solve my recent Perl
problem I collect my previous posts on this list.
I have bar separated file (FILE_A):
name1|10
name2|20
name3|5
name4|30
etc.
I processed it with
David Gilden am Samstag, 18. Februar 2006 16.29:
Good morning,
Good evening here ;-)
I would like to populate a hash from a csv text file, then test for the
existence of a value in the hash. If not found return an error message and
exit.
ithe text file will have the format of:
# whitelist
Kenneth Moeng am Freitag, 17. Februar 2006 07.21:
Hello there, I have a problem with property definition of this code,
please have a look.
#!/usr/bin/perl -w
Hello,
What is the property definition in your code and what problems do you have
with it?
Hans
--
To unsubscribe, e-mail: [EMAIL
Tom Phoenix am Mittwoch, 15. Februar 2006 01.59:
On 2/14/06, Hans Meier (John Doe) [EMAIL PROTECTED] wrote:
I'm fine with that, but still don't understand how a path present in @INC
is ignored.
It sure looks like it's in @INC, from the message. (You may know that
PERL5LIB is sometimes
Dear list
It's very strange:
My apache doesn't start with
[error] Can't locate SMF/Config.pm in @INC (@INC contains: /opt/smf/lib [...])
at /opt/smf/apconf/backend/httpd_startup_smf.pl line 228.
But why? The file is there:
# ls /opt/smf/lib/SMF/Config.pm
/opt/smf/lib/SMF/Config.pm
and the
Hans Meier (John Doe) am Dienstag, 14. Februar 2006 19.08:
It's very strange:
My apache doesn't start with
[error] Can't locate SMF/Config.pm in @INC (@INC contains: /opt/smf/lib
[...]) at /opt/smf/apconf/backend/httpd_startup_smf.pl line 228.
But why? The file is there:
# ls /opt/smf
Gerald Wheeler am Dienstag, 14. Februar 2006 21.03:
I am trying to allow input of a person's first and last name in one form
field, nothing more, nothing less
There should be only one uppercase A-Z character followed by one or
more lowercase a-z characters followed by one space followed by
Hans Meier (John Doe) am Dienstag, 14. Februar 2006 21.35:
if (/^\s*([A-Z][a-z])+\s*([A-Z][a-z])+\s*$/) {
# input is ok, so now we format:
my $formatted=$1 $2;
do_something_with($formatted);
}
Sorry, this is completely bullshit, shuld have tested before hitting send.
my $userinput
nishanth ev am Dienstag, 14. Februar 2006 17.56:
hello Friends,
Have anyone tried stopping a service say httpd usng a
cgi script ?
I have set a setuid for the cgi script and the script
is in the root cgi-bin directory namely
/var/www/cgi-bin/ with ownership root and have the
following
Bowen, Bruce am Sonntag, 12. Februar 2006 22.31:
I have a text string = ^0176 ^0176
I have set $a = ^0176 ^0176;
I have set $b = ^0176 ;
I'm using text =~ s/$a/$b/g;
And the text string doesn't change. I expected it to come out as ^0176
after the substitution. What is wrong with my
Stephen Mayer am Montag, 13. Februar 2006 17.25:
Bruce,
What you want to use is `perl -d file.pl arguments`
...and especially the manuals provided with every perl installation, which is
a very valuable source for information.
Some tips:
$ perldoc perl # lists manuals.
# search if a
Tom Allison am Dienstag, 14. Februar 2006 02.28:
I was trying out some jobs with the Berkeley DB and decided to move up from
DB_File to BerkeleyDB. I don't need a lot of features, just speed.
But I keep running into a dumb error that doesn't make any sense to me.
untie attempted while 1
49 matches
Mail list logo