How to turn off mouse focus?

2001-04-28 Thread Hans
causes the -command flag to be executed with every movement, even though the value of the scale is not changed. Anyone any thoughts on how to do this? Thanks for the help. --Hans

Pack trouble

2001-04-28 Thread Hans
Someone please enlighten me. I can't for the world figure out what is wrong here. - I create a main window. - In this window I create a frame. - In this frame I create four buttons. - The buttons need to be packed like this: TOP LEFT RIGHT BOTTOM1 BOTTOM2 -Instead the

regex on hash keys?

2001-06-13 Thread Hans Holtan
Hi everyone, I'm a bit green, and I'm trying to split a large file into a hash. My problem is that the parts that I want to use as keys are a bit long (100-200 letters), and I will need to pull them out by the presence of certain substrings later. So my actual question is this, how do I retre

using strict

2001-06-27 Thread Hans Holtan
Hi everyone, I get this error when I run my script, and I don't understand why: "Can't use string ("CHR3") as a symbol ref while "strict refs" in use at AtIntergenicTableSort.pl line 53. " I'm trying to split my output into 5 seperate files based on what is in the key. Here is a snip of code

using strict - ADDENDUM

2001-06-27 Thread Hans Holtan
Hi everyone, I forgot to mention that I did open the output files earlier in the program, ie CHR1, CHR3 ... CHR5. Here is the whole thing: #!usr/bin/perl -w use strict; my ($input,$output,$k,$v,$gene, $input_string, $output1,$output2,$output3,$output4,$output5, $file, $junk,$i,

newbie: relative directory paths not working

2001-07-15 Thread Hans Holtan
Hi everyone, I find that I must use absolute directory paths to access files from my perl scripts. If I just name a file: open (FH, "

NIS, NIS+, or Standalone

2001-08-08 Thread Baartmans, Hans
I am trying to write a little script to determine is a UNIX system is using NIS, NIS+, or a standalone system. Any suggestions on how to approach this? Thanks in advance! Hans

Check file permissions

2001-08-09 Thread Baartmans, Hans
Is there a module or command that returns the permissions of a file or directory? Thanks, Hans

getpwent & getgrent

2001-08-10 Thread Baartmans, Hans
Are there any equivalent functions for getpwent or getgrent in the NIS environment? I am able to get the local password information using these functions. Can they be extended to query the NIS information? Thanks!

Check to see if process exists

2001-08-21 Thread Baartmans, Hans
sy way to do this in Perl? Thanks in advance!!! Hans

Perform a tar command on a directory

2001-08-23 Thread Baartmans, Hans
! Hans

using regular expressions to find sequences of items in data

2002-01-06 Thread jon hans
#!/usr/bin/perl ### I am trying to find all of the reoccurring sequences excluding the sub sequences. Maybe I am missing the obvious, but having a little perl exposure and not being an expert perl programmer I have hacked together some code tha

Module Installation Question

2004-10-24 Thread Stefan Hans
Hi *, I want to install the Spreadsheet-WriteExcel-2.11 with the prerequisites Parse::RecDescent and File::Temp. Version: This is perl, v5.8.0 built for i386-linux-thread-multi @INC: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i

thx

2004-10-25 Thread Stefan Hans
nt: Monday, October 25, 2004 12:34 AM Subject: Re: Module Installation Question > Stefan Hans wrote: > > What I have done: > > > > # cp ./lib/Parse/RecDescent.pm /usr/lib/perl5/5.8.0/ > > > > > My problem: > > > > Warning: prerequisite Parse::RecDesce

finding max value

2002-02-12 Thread Hans Holtan
Hi everyone, I have a set of functions that give numeric results, and I need to compare them and choose the maximal value. Is there any simple way of finding max? Hans -- Hans E. E. Holtan Graduate Student UC Berkeley-Department of Plant

searching a large file

2002-02-28 Thread Hans Holtan
search, but it's a serious hog, and I need to leave a lot of memory open for other operations. Does anyone have suggestions on how I can do this while limiting memory usage, speed is a factor but not paramount. Thanks, Hans -- ____ Hans E. E. H

Re: Question about writing to file

2002-03-28 Thread Hans Holtan
of question hash and answer hash are not equal.\n"; >exit(); >} >else{ > for (my $i=1; $i<=$#qk+1;$i++){ >print In1 >"Question"."$i".":factor$Question_hash{$qk[$i-1]}=$Answer_hash{$ak[$i-1]}\n"; >} >} >close In1; >} >

Re: log file question

2002-04-03 Thread Hans Holtan
Hi Lance, I don't know if this is too general for your purposes, but this should look through a whole file and find anyplace that the word "running" appear in three consecutive lines. open (INFILE, "+; for (0 .. ($#all_lines-2)){ if ( ($all_lines[$_] =~ m/running/gi) a

References

2002-04-21 Thread Hans Holtan
Hi folks, The code shown bellow is supposed to de-reference a hash-reference of array-references and print everything out nicely. But the array references do not get de-referenced. I really appreciate the help. Thanks, Hans #!usr/bin/perl -w use strict; use warnings; use diagnostics; my

use Getopt::Std; and use strict;

2002-05-10 Thread Hans Holtan
"$opt_m" requires explicit package name If I don't use strict the program runs fine. Is there anything I can do about this? Does anyone use both together? Thanks for the help. -Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

negate, !!$a, $a!!, flip-flop

2013-09-09 Thread Hans Ginzel
Hello! Is there a shorter way to write $a = ! $a, please? Something analogous to ++ and -- operators like $a !! or !! $a would negate the variable $a and return its previous or new value respectively. Best regards HG -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional c

share a variable between files

2014-10-08 Thread Hans Ginzel
other file. I realised, that there is possible without warning to define a subroutine in another package, but not to use a global variable from that package (=namespace). Thank you Hans -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: share a variable between files

2014-10-09 Thread Hans Ginzel
On Thu, Oct 09, 2014 at 03:50:02AM +1300, Kent Fredric wrote: First, what are you trying to acheive. Global variables are rarely a good idea, as is sharing variables between files. So the question is, why are you trying to share a variable between files using globals? My suggestion is

Fwd: copy unicode (UCS-2) file

2014-11-26 Thread Hans Ginzel
In addition, is there a standardised way to auto-detect input encoding (legacy(8bit)/utf-8/ucs-2), please? Best regards Hans Ginzelÿþa b ÿþa b -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Substitution operator is not working in perl - Windows OS

2014-12-04 Thread Hans Ginzel
%VERSION%/ABC/ See perldoc perlrun, the examples under the -i option. It is possible tu run this whole from command line perl -i.orig -pe ^"s/^%VERSION^%/XYZ/g^" file.txt but under windows you need to escape percent signs complicatedly. http://superuser.com/questions/40

say,

2015-01-05 Thread Hans Ginzel
about say() on Mac or Windows? Thank you, Hans -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Open output file in same endianess as input file – UTF-16be vs. UTF-16le

2015-03-04 Thread Hans Ginzel
he same endianness as input file, please? How to get endianness/encoding from the input file handle $in? PerlIO::get_layers($in) returns among other layers encoding(UTF-16). Thank you Hans Ginzel -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

ppm, download and install modul separately

2005-09-18 Thread Hans Ginzel
Hello, how can I download a module with ppm, copy downloaded file to another computer and install it there? Something like pc1$ ppm ppm> search DBD-ODBC ppm> download 1 ppm> quit pc1$ cp DBD-ODBC*.pm.tar.gz flash_disk/ pc2$ cp flash_disk/DBD*.gz . pc2$ ppm install DBD*.gz Best regar

Re: @ARGV

2005-09-18 Thread Hans Ginzel
John W. Krahn napsal(a): arguments. Then how come I cannot access the first element with $ARGV[0]? Are tou not thinking on $0? HG -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: @ARGV

2005-09-20 Thread Hans Ginzel
Binish A R napsal(a): arguments. Then how come I cannot access the first element with $ARGV[0]? I think @ARGV wont work in command line. Try to write the code in a script and check it out. #!/usr/bin/perl -w print $ARGV[0]; $ perl script.pl arg_1 This returns arg_1 same as c:\>perl -e "

Re: how to count?

2003-06-08 Thread Hans Holtan
Hi Jerry I'm not sure, but maybe this is what you mean: my @IDS = qw (a b c d e f g); my $c=0; foreach my $id (@IDS){ $c++; $id.=$c; print "$id\n"; } # Hans On Sunday, June 8, 2003, at 09:41 PM, Jerry Preston wrote: Hi! I am not sure if this can be don

Capturing system output to a variable

2005-04-18 Thread Hans van Leeuwen
way to do this. Is there any way I can print the output from "OPEN" to a variable instead of a file? Thanks. Hans #!/usr/bin/perl sub head { push(@head, "@_"); print "\n@_\n\n"; } $| = 1; open(STDSAVE, ">&STDOUT"); open(STDOUT,">

Re: substitution

2006-02-13 Thread Hans Meier (John Doe)
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

Re: single step - debug mode

2006-02-13 Thread Hans Meier (John Doe)
Stephen Mayer am Montag, 13. Februar 2006 17.25: > Bruce, > > What you want to use is `perl -d file.pl ` ...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 manual exist

Re: BerkeleyDB

2006-02-13 Thread Hans Meier (John Doe)
; my $value = $hash{$y}; > print "get "; >} else { > my $value = md5_hex(@$t); > $hash{$y} = $value; > print "put "; >} >print tv_interval($t, [gettimeofday]),"\n"; > } > > untie %hash; The one inne

Strange "Can't locate Module.pm in @INC" error after chaning from 'use lib' to PERL5LIB

2006-02-14 Thread Hans Meier (John Doe)
;pasted around to avoid typos, tried to find someting with strace, etc., but to no avail. Could anybody please give me a hint what could be the reason? It must be something very stupid, but I can't see it. Thanks a lot! Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addition

[RESOLVED (workaround?)] Re: Strange "Can't locate Module.pm in @INC" error after chaning from 'use lib' to PERL5LIB

2006-02-14 Thread Hans Meier (John Doe)
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. > &g

Re: regexpressions help

2006-02-14 Thread Hans Meier (John Doe)
Z][a-z])+\s*([A-Z][a-z])+\s*$/) { # input is ok, so now we format: my $formatted="$1 $2"; do_something_with($formatted); } hth, Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: regexpressions help

2006-02-14 Thread Hans Meier (John Doe)
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 b

Re: Stopping a Service with cgi

2006-02-14 Thread Hans Meier (John Doe)
ble. You could set up a cron job to test modification time of the touched file and stopping/restarting the service accordingly (and, e.g., let it send a notification mail to you or any other recipient not provided by the webinterface user). In any case, be careful not to enable DOS-attacks. hth,

Re: [RESOLVED (workaround?)] Re: Strange "Can't locate Module.pm in @INC" error after chaning from 'use lib' to PERL5LIB

2006-02-15 Thread Hans Meier (John Doe)
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

Re: :: and ->

2006-02-17 Thread Hans Meier (John Doe)
Ken Perl am Freitag, 17. Februar 2006 02.34: > what is the difference of :: and -> in this statements? > > $authInstance = > Operation::Auth::getInstance($session,$u->authMethod,$u->userId) > > $authInstance = > Operation::Auth->getInstance($session,$u->authMethod,$u->userId) The first '::' is par

Re: property definition

2006-02-17 Thread Hans Meier (John Doe)
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 unsubsc

Re: Process large file with hash

2006-02-18 Thread Hans Meier (John Doe)
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 process

Re: populating a Hash

2006-02-18 Thread Hans Meier (John Doe)
to having a working script, I have guessed at some of syntax > here, and am not familiar with using 'defined'. use strict will reveal syntax guesses. BTW, there is also a short way to get the data into %hash. Before just using it, please read the man pages for map and grep. (The us

Re: Error in the "if" block

2006-02-19 Thread Hans Meier (John Doe)
serIn)=$userIn=~/^\s*((?:\d+\s*?)+)\s*$/; > my @numbers = split( / /, $userIn ); This only splits on a single space character. my @numbers = split /\s+/, $userIn; splits (explicitly) on the same whitespace allowed in the regex above. hth! Hans [irrelevant parts snipped away] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Error in the "if" block

2006-02-19 Thread Hans Meier (John Doe)
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 po

[OT] Re: perl with databases

2006-02-19 Thread Hans Meier (John Doe)
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: [EMA

Re: Net::Server

2006-02-19 Thread Hans Meier (John Doe)
7;/var/run/net_test.pid', > 'listen' => '16', > 'log_level' => '4', > 'reverse_lookups' => '1', > 'user' => 'nobody',

Re: Repeated Regex over a line with double quotes

2006-02-21 Thread Hans Meier (John Doe)
Wagner, David --- Senior Programmer Analyst --- WGO am Dienstag, 21. Februar 2006 23.55: > here is a small snippet of code(LABEL1) which appears to remove a comma > which lies between two double quotes. I run it and and display output and > the one line of code which does have the comma is c

Re: Type globs of subroutines?

2006-02-22 Thread Hans Meier (John Doe)
(passing a subroutine reference as argument to a subroutine): is unrelated to the above. perl -le 'use warnings; use strict; \ sub sub1{shift->()}; \ sub sub2 {2}; \ warn sub1(\&sub2); ' hth Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai

Re: A problem with apache installation http://localhost issue

2006-02-22 Thread Hans Meier (John Doe)
re the testing. Apache only listens on IPs and Ports that are configured in the httpd.conf. Yours seems not to be configured to listen on 127.0.0.1, you can check that by $ netstat -neatp Depending on your apache configuration, a Listen 127.0.0.1:80 in the httpd.conf may be sufficient. hth, Han

Re: Why does my inheritance hierarchy get screwed up?

2006-02-22 Thread Hans Meier (John Doe)
@ISA is coming from, since B 'isa' Exporter. It seems that - see to the order of paths in your @INC - the core B is loaded and not your B. Sorry, I did not delve deeper in your code. hth Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: simple references question

2006-02-22 Thread Hans Meier (John Doe)
produced) declared. Without 'my', you can't know that, but have to look into the whole code to find out if you are just declaring it at the position or using it: Your perspective, then, is less locally than possible. Since you ask a question like that one in your original post

Re: Extract multiple lines

2006-02-23 Thread Hans Meier (John Doe)
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

Re: Extract multiple lines

2006-02-23 Thread Hans Meier (John Doe)
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

Re: simple references question

2006-02-23 Thread Hans Meier (John Doe)
broutines provided and saving is done with one line of code. The object oriented paradigma allows for again more resusability... Check the perl documentation perldoc perl Look at the mass of modules on search.cpan.org, and there are certainly lots of online resources in english available (wh

Re: simple references question

2006-02-24 Thread Hans Meier (John Doe)
test script... a) listing all present modules b) checking if the required ones are present (with eval {use module}; or so) hth, Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: tar command

2006-02-24 Thread Hans Meier (John Doe)
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] Fo

Re: tar command

2006-02-24 Thread Hans Meier (John Doe)
ing to > shell prompt or not executing next command > > plz let me know any other option. > > Regards > Irfan Sayed [...] What about using the additional -z option of tar, so you don't have to call gzip separatly? hth Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Re: alternating bgcolor in rows

2006-02-24 Thread Hans Meier (John Doe)
$color = "#303030"; > } else { #even rows > $color = "#00"; > } > print qq() . join ("", > @$row) . "\n"; > } > print "\n\n"; > } else { > print "No matches found\n"; > } Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: alternating bgcolor in rows

2006-02-24 Thread Hans Meier (John Doe)
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.pe

Re: alternating bgcolor in rows

2006-02-25 Thread Hans Meier (John Doe)
trict; use warnings; use overload '""' => \&color; sub new { my $class=shift; bless {c=>[EMAIL PROTECTED], i=>0, n=>[EMAIL PROTECTED], $class; } sub color { my $self=shift; my $c=$self->{c}->[$self->{i}]; $self->{i}=++$self->{i} % $self-

[rather OT] Re: alternating bgcolor in rows

2006-02-25 Thread Hans Meier (John Doe)
external stylesheet from every generated page - assign css-classes to every x(html) element The latter allows you to locate a specific element within the page by css at any later time: You are prepared to do layouting things you don't think of at the moment - only in one file. Again, sorry for being offtopic. Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: problems parsing a DHCP.leases file.

2006-02-27 Thread Hans Meier (John Doe)
ethernet 00:0b:97:2b:ea:fe; uid "\001\000\013\227+\352\376"; client-hostname "HOST1"; } lease 10.10.97.208 { starts 2 2005/12/20 16:10:51; ends 2 2005/12/20 20:10:51; tstp 2 2005/12/20 20:10:51; binding state free; hardware ethernet 00:0b:97:2b:ea:fe; uid "\001\000\013\227+\352\376"; client-hostname "HOST2"; } = This prints out: lease '10.10.97.207' (host 'HOST1') has binding state 'free' lease '10.10.97.208' (host 'HOST2') has binding state 'free' hth, Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: problems with logical && (and) statement

2006-03-04 Thread Hans Meier (John Doe)
t use strict; use warnings; at the top of your code; may give you hints about "semantic" errors. hth, Hans [snipped] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: hash of hashes & arrays

2006-03-04 Thread Hans Meier (John Doe)
y get changed, so is there any function that > can help me to print all the %info data to be like this : > > system.load.1 > system.load.2 > .. > .. > system.hostname > system.network.eth0.ip > ... > system.mount././dev/sda1 > system.mount./.100 > system.mount./.10%

Re: How to display database records in a web page !!!!

2006-03-06 Thread Hans Meier (John Doe)
nt of Database is bug_id who bug_when work_time thetext isprivate > already_wrapped 6 , 4 , 2006-02-23 10:35:09 , 0.00 Test > ! 0 0 7 , 6 , 2006-02-23 10:52:50 , 0.00 Test for 0 0 [...] > i want the code to display records like a clear report with individual > fileds having spaces in between them, i hav been fighting with the > code for longtime . hth, Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: [regexp] Warnings on Backreferences

2006-03-06 Thread Hans Meier (John Doe)
am, just to sum up: $test =~ s{ (.*?) \( (.*?) \) } {$1}xsg; - "\(" instead of "[(]": more readable - no /m modifier : unnecessary without ^/$-anchors - /s : may be appropriate for your html source text :-) Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Directory issue

2006-03-07 Thread Hans Meier (John Doe)
avoided in system calls anyway). But the line has another two problems: First, $? (not $_) contains the exit status of system. Second, success in the shell is indicated by a return value of 0, which is true in the shell, but false in perl. So, this codeline dies always if system succeeded and n

Re: [regexp] Speaking of the /s modifier...

2006-03-07 Thread Hans Meier (John Doe)
Adam W am Dienstag, 7. März 2006 23.16: > Hans Meier (John Doe) wrote: > > just to sum up: > > > > $test =~ s{ (.*?) \( (.*?) \) } > > {$1}xsg; > > > > - "\(" instead of "[(]": more readable > > - no /m modifier :

[getting OT?] Re: [regexp] Speaking of the /s modifier...

2006-03-07 Thread Hans Meier (John Doe)
nother post already. > I call it "the book that got > me my free mini convertable and got me a substantial promotion". Sorry, too much for my english capabilities... > but do what you like :) Thanks - you too :-) [...] Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: [regexp] Speaking of the /s modifier...

2006-03-07 Thread Hans Meier (John Doe)
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

[OT] sanitize/sanitise ? [was: [regexp] Speaking of the /s modifier...]

2006-03-08 Thread Hans Meier (John Doe)
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 "sani

Re: multistring replacement

2006-03-08 Thread Hans Meier (John Doe)
is just a "hack" and assumes correct html syntax as well as no '>' and '<' in tag attribues. Correct regexpes would be longer. A more structured way to do such things is the usage of one of the html parsers on search.cpan.org. Some of them can deal with erroneos html, others can not. hth, Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: counting scalar array elements question

2006-03-08 Thread Hans Meier (John Doe)
'b', > > 'c' > > ] > > > > > > So I can do: > > > > my [EMAIL PROTECTED]; > > > > > > Can anyone shed any light on this or suggest a better way of doing this? > >Timothy Johnson am Donnerstag

Re: counting scalar array elements question

2006-03-09 Thread Hans Meier (John Doe)
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 u

Re: Does this script have the efficiency problems?

2006-03-09 Thread Hans Meier (John Doe)
SULT "%-25s%-20s\n", $_."128", $_."255"; > } > } > > close RESULT; > > > > The files handled by the script are looked as: > > 211.139.227.247:3088 > 220.181.31.245:1134 > 220.181.31.247:1126 > 220.181.31.2

Re: the only difference is the 'x' after '/g'

2006-03-30 Thread Hans Meier (John Doe)
1st regex are irrelevant. Look at the first regex space: in the 2nd regex, it matches (only) in "From a", but not in "From: c", whereas the 1st regex matches "From a" *and* "From: c". /From[^\n]*?\n.*?(From: .*?\n).*?/gx; and /From[^\n]*?\n.*?(From: .*?\

Re: Counting specific elements in a XML object

2006-03-30 Thread Hans Meier (John Doe)
e must be an > easier way. Ok, let's start with: perl -e 'while(){//&&$i++};print $i' < data.xml Anybody with an easier way in the sense of - less typing - more understandable - less module imports ;-) ? [preconditions: nothing else to do with the input; no CDATA containin

Re: Counting specific elements in a XML object

2006-03-30 Thread Hans Meier (John Doe)
Gavin Bowlby am Donnerstag, 30. März 2006 21.45: > How about: > > cat fn | grep | wc When I posted a "cat | grep" the first (and last) time, several people got a well known heart attack :-) grep fn | wc > as a non-Perl approach to the problem... [...] Agreed, but OT

Re: Counting specific elements in a XML object

2006-03-30 Thread Hans Meier (John Doe)
Chas Owens am Donnerstag, 30. März 2006 22.35: > > > cat fn | grep | wc [...] > > grep fn | wc [...] > If we are going to pick nits then it should be > > grep -c "" fn too much work. c "" fn But your alias may be different ;-) Hans -- T

Re: Counting specific elements in a XML object

2006-03-30 Thread Hans Meier (John Doe)
missed the END block idea to finally print the sum. (And again, problems that seem to be trivial are not in many cases...) Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: the only difference is the 'x' after '/g'

2006-03-31 Thread Hans Meier (John Doe)
tching. Look at the beginning of perldoc perlre hth! 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); > >