Kevin Pfeiffer wrote:
> I'm trying to fix a couple small problems in WWW::LEO.pm (accesses the Leo
> German-English web server). One problem I can't solve. After switching to
> my current Linux (SuSE) my leo script returns, for example:
>
> "merkwrdig" inst
not display)
Perhaps this is because the command line is now UTF. The webpage encoding is
charset=iso-8859-15. Looking at a dump of what HTTP::Request gives me I
see:
merkwrdigerweise
Is there an easy way to convert the iso-8859-15 charset to UTF-8 (what I
think my commandline is)?
-K
--
Kevin P
.
-Kevin
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
I look at
> (including Makefile.PL) seems to be geared to module installation.
Meanwhile I found useful information in the perltidy package at CPAN.
-K (hope this arrives)
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http:/
is is still
justifiably the best newsgroup/mailing list out there.
-K
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
This is a good example of the problem with top-posting; particularly in this
list: I have no idea to which part of which poster your comment refers.
Sorry about complaining (I try to ignore this behaviour), but it does cause
problems in readability and comprehension (especially here). Not to menti
"Doe"
$/ = ""; # treats empty line(s) as record terminator
while() {
if (m{DateField1:\s+$DateField1} ||
m{Name:.*$Name}) {
print;
}
}
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
someone here will likely have a better answer) might be
to run the script in setuid mode (use chmod to set permissions for script
to '4755'); script will run as its owner instead as 'www-data'.
-Kevin
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>, Brian Gerard wrote:
> And the clouds parted, and Kevin Pfeiffer said...
[...]
>> If I don't escape the slash in the char class -- i.e. /([^\/]+)$/ -- I
>> get this error:
>> Unmatched [ in regex; marked by <-- HERE in m/(
In article <[EMAIL PROTECTED]>, Kevin Old
wrote:
[...]
> Yeah, I guess that's it. I'm not really sure how it works (yet), but I
> got it from Programming Perl. Here's that whole subsection:
Thanks. I see I just need to "do my homework".
--
Kevin Pfeiffer
e supplied reference for hashes and
arrays, and coderefs.
The 1st sentence I understand, but not "the dereferenced type of the
supplied reference."
I just tried this without the asterisk and get "$entry" instead of "%entry"
(or "$VAR1" using the plain procedure).
So in plain(er) English that means: if the name begins with an "*", the
output type will match that of the referenced variable"?
-K
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
in the form:
>
> $hash = {
>album => "Prose Combat",
># etc...
> }
Try...
use Data::Dumper
print Dumper(\$hash_ref);
(If I understood what you mean)
-Kevin
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
1)
If I don't escape the slash in the char class -- i.e. /([^\/]+)$/ -- I get
this error:
Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ^/ at ./test-0
line 7.
This makes no sense to me (since this is Perl and not sed or something)...
(implied Question 2)
-Kevin
--
Kevin Pfe
s way?
Printing to a file handle that was opened for reading?
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
kage Parent::Module::MyModule;
You may not need it anymore, but for anyone else, I found the "Learning
Objects, References & Modules" book to be really helpful with all this.
-K
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>, Rob Dixon wrote:
> Kevin Pfeiffer wrote:
>>
>> I would have thought that this would initialize my $indent variable to 2
>> (like setting an initial state for an object), but if I call "indent()" I
>> get nothing ba
the rest."
If you look at perldoc -f split and then try a couple tests, you should be
able to get what you want.
-Kevin (no expert though)
P.S. - No top-posting please.
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
$indent += $increment if $increment;
return $indent;
}
}
-Kevin
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>, Rob Dixon wrote:
> Kevin Pfeiffer wrote:
>>
>> I would have thought that this would initialize my $indent variable to 2
>> (like setting an initial state for an object), but if I call "indent()" I
>> get nothing back. :
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote:
> I've painted myself into a corner I can't get out of...
>
> Missing right curly or square bracket at /home/pfeiffer/bin/trash line
> 341, at end of line
> syntax error at /home/pfeiffer/bin/trash line 3
341 is, of course, the end of the file! The problem is, vim thinks that
the syntax is just fine (without vim I'm nothing)! :-|
Is there some trick to getting oneself out of this quagmire??
-Kevin
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
Hi David,
In article <[EMAIL PROTECTED]>, David wrote:
> Kevin Pfeiffer wrote:
>
>> Hi all,
>>
>> I just took another look at an exercise I wrote a couple months ago and
>> fleshed it out a bit. It is a commandline "trashcan" program which I
&g
mpty directories (which I
ignored the first time I worked on this) and remembered from my objects
book that I needed a recursive function to first clear out my directories.
Amazingly, I actually remembered how to do this (okay, it's not that
difficult, I know).
Thanks,
-Kevin
--
Kevin Pfeif
dfksdksdk
Or this:
s|\./||g;
print;
...which produces this:
a b dsfj/dfl/dksl ksdfl/dsld
c d sds/dsl/dksld kdf/ksd/ksdk
...if that is what you want (I'm not quite sure).
-Kevin
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote:
> In article <[EMAIL PROTECTED]>, Raghu Murthy wrote:
>
>> I need to remove ./ and #from a list of files. I can do it in sed but I
>> am not able to use it in my perl script. I tried to do something like
g like:
while () {
s|^#+\s*||; # remove leading #s and any spaces
s|^\./||;# remove leading "./"
print;
}
To remove the entire line add "next if " in front of the regex.
-K
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote:
> In article <[EMAIL PROTECTED]>, Charles K. Clarkson
> wrote:
>
>> Kevin Pfeiffer <[EMAIL PROTECTED]> wrote:
>>
>> : Where I am stuck is on the question:
>> :
>> : Given an @array s
In article <[EMAIL PROTECTED]>, Charles K. Clarkson
wrote:
> Kevin Pfeiffer <[EMAIL PROTECTED]> wrote:
>
> : Where I am stuck is on the question:
> :
> : Given an @array such as
> : ("Title of Song", "Artist", "Title", "A
t;Title", "Another Artist", "etc"),
is there an easy way to strip out the quotation marks. This
sounds like something for a map function -- which I'm willing
to work out for myself if you all think this is the best way.
The arrays come from the line split mentioned just above (see
"###" line). I'm splitting on "|||"s.
-Kevin
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote:
[...]
> while () {
>
> chomp;
> print;
> last if /^0$/;
> }
>
> print "\n";
Whoops, too fast for my own good (points off for carelessness):
while () {
chomp;
print unless /^0$/;
}
ame line?
There is probably some subtlety of handling hexadecimal (just learned how to
add and subtract it yesterday) that I'm overlooking, but on the surface,
how about something as simple as:
while () {
chomp;
print;
last if /^0$/;
}
print "\n";
--
Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote:
[...]
> The thing to add (I'd have to check the Perl Cookbook for the terminology)
> is a "reverse lookup"(?) so that in addition to:
>
> $album{$upc}
>
> you could also access your data via:
>
>
R WORLD"',
'"12. I AM A MAN OF CONSTANT SORROW"',
'"13. WRAPPED UP IN YOU"',
'"14. NOT A DAY GOES BY"',
;;
>>
>> True, but I was looking for a way to do this with a somewhat "buried"
>> unless keyword.
>
> print +( qw(second first --> unless <--) )[ not $counter ];
??? :-|
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
row out the first and last item.
-K
__DATA__
"ALL-TIME FAVORITE COUNTRY LOVE SONGS UPC#: 0-84296-33172-7"||"COUNTRY MALE PARTY
SONGS VOL. 1 UPC#: 0-84296-21772-4"||"COUNTRY FEMALE PARTY SONGS VOL. 1 UPC#:
0-84296-21712-0"|||
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
not the
challenge of unwrapping, counting commas, pipes and quote marks, etc.
I don't know if it's the best solution (perhaps an attachment is better),
but I will usually send code unwrapped (during the rare moments when I have
something to offer) and then hard-warp the 'splanatory
m wondering if there is a simple way of populating @files
>> by using a date comparison operation of each file to the local time. I've
>> tried long complicated methods of using 'stat' and Time::Local but I was
>> hoping for a simpler solution.
>
> Ah, a simple
s formatted row
foreach my $col (@{$_}) {
printf "%16s|", $col;
}
print "\n";
}
}
-Kevin
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
ng program.
Or, with the BLKKTL/Black Kettle mentioned earlier, maybe you can first
detect a system of sorts (i.e. dropping vowels and double consonants)?
Best would be to engage in some monopolistic price-fixing first and then you
could match on price! ;-)
--
Kevin Pfeiffer
International U
gt; }
> # yes, the above can be simplified a lot, if it bothers you
> # but that is left as an exercise to the reader
> }
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
foreach (@AoA1) {
print "@{$_}\n";
}
print "\n\n";
print "Array 2:\n";
foreach (@AoA2) {
print "@{$_}\n";
}
print "\n\n";
print "Array 3:\n";
foreach (@AoA3) {
print "@{$_}\n";
}
print "\n\n";
print &qu
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote:
[...]
> What does the last line do. I looked at man threads:
> $thread->join
>This will wait for the corresponding thread to join. When the
>thread finishes, join() will return the return values of
&
the
thread finishes, join() will return the return values of
the entry point function."
Printing these out (i.e.):
foreach (@kiddies){
$_->join();
print "$_ joined.\n";
}
gives me:
threads=SCALAR(0x81de948) joined.
threads=SCALAR(0x81e180c) joined.
e
> Another one - regexEvaluater:
Cool. Thanks to you both. I could have used these a day ago! :-) Something
for the Perl.Beginners FAQ (oops, that'd mean I'd have to write one?).
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
homp is to remove line returns, but you don't have any
How about:
my @to_kill = ("`pgrep snp.pl`", "`pgrep snoop`");
> foreach (@snp) {
> #print("Killing $_\n");
>`kill -9 $_`; --Shouldn't this be: system "kill -9 $_"; #??
> }
In article <[EMAIL PROTECTED]>, R. Joseph Newton wrote:
[...]
> I'm not fond of this particular construct, but then, I'm not fond of grep,
> either. I'd rather use something called get_all_matching().
Oh, you mean 'gam' ;-)
--
Kevin Pfeiffer
International U
ce
pop @line;
print $clear_line, $prompt;
print @line;
} else {
$history_ptr = 0;
print $char;
push @line, $char;
}
}
ReadMode('normal');
I suspect that Term::ReadLine is the easier way to go but have not looked at
it too closely
ypercardish thing called TuxCards -- feeble
brain. :-(
Thanks for the tip!
-K
--
Kevin Pfeiffer
International University Bremen
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
uot;, @list, "\n";
produces output such as:
a,
a, b, c,
whereas:
print join(", ", @list), "\n";
produces:
a
a, b, c
(no trailing comma) -- strange... I think I remember reading somewhere that
without the parentheses 'join' doesn't really know exa
by inputting things like "eighteen dollars and 0
> cents" in a form with an explicit $ sign in front.
As Joseph more or less said, error-trapping and verifying input is not the
user's job (well, unless she's doing quality control work).
Checking whether numerical input is
nd use it like an OO-method getter/setter. You call it with a
value (file_mode("r") and it sets this value. You call it without any
parameters and it returns the current value.
Is this a valid alternative to global variables?
-K
--
Kevin Pfeiffer
International University Bremen
--
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote:
[...]
> This worked better and was easier (once I remembered to update 'ISA@')
> than I expected! I ended up adding two or three new methods and modifying
> four.
Errr, ah "@ISA"... (that was the Hebrew not
I have a feeling this a FAQ...
I've CPANed so many modules I no longer know which came with Perl and which
not. How can I determine this?
Thanks in advance!
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [
here (makes following code and comments easier).
-K
--
Kevin Pfeiffer
International University Bremen
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
you can) It's easier to see what
is being done when they are separate.
Even easier (I think) would be if you write:
s|/\*|!|; # or
s{/\*}{!};
-K
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
ing to extend another method, and now that I've got these sorted out
into two separate modules, it's quite easy.
-K
--
Kevin Pfeiffer
International University Bremen
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>, Jeff
'Japhy' Pinyan wrote:
> On Sep 29, Kevin Pfeiffer said:
[...]
>>My working copy is now called AliasFilePlus.
>>
>>What do I do with this if I try to share it? The changes to the module
>>seemed too great (and to
peace officers, to take either me or Doctor Slammer,
of the 97th Regiment, at present quartered in Chatham Barracks, into
custody, and thus prevent this duel!--I say, do not.'
Mr. Snodgrass seized his friend's hand warmly, as he enthusiastically
replied, 'Not for worlds!'
has some good questions lately I see; I will try to
catch up),
-Kevin
--
Kevin Pfeiffer
International University Bremen
Your message here
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>, R. Joseph Newton wrote:
> Kevin Pfeiffer wrote:
>
>> I thought the easy way to do this is to first assign my entire 'en' data
>> structure to the 'de' structure and then add 'de' values as available.
>>
r aliases file and add this line.
> support: root,"|/path/to/your/openticket.pl"
> and than run, "newaliases"
No, it reads /etc/aliases and updates the alias database; try 'man
newaliases' for more info.
-K
--
Kevin Pfeiffer
International University Bremen
--
first assign my entire 'en' data
structure to the 'de' structure and then add 'de' values as available.
So I did this:
$text{'main'}{'de'} = $text{'main'}{'en'};
$text{'main'}{'de'} = { # Germ
this:
And this actually works quite fine I think...
> I hope that helps a little.
>
> Rob
Thanks, that helped a lot! (Thank you also to others who responded.)
Meanwhile my "naive ticketMachine" is chugging along. And I like doing the
Perl version of something else; it's go
hat perhaps the difference is that in Perl you can call
methods on a class (i.e. the "an unnamed horse" from the Perl Objects book)
but not in Java (other than the contructor method)?
(If anyone is interested in BlueJ -> www.bluej.org)
-K
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi all,
(372 unread messages, I'm getting behind, again)
If I understand things correctly, perl modules, i.e. "mymodule.pm" never
need the exec bit set for (for example, wwwrun) - they're only used by
another perl script?
-K
--
Kevin Pfeiffer
International Univer
;> Another Company Name Ltd **
>>
>> while retaining spaces.
>
> $text =~ s/(\w+)/\L\u$1/g;$y
^^
$y? A mysterious Perl variable that I've missed?
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
two different sized arrays?
Parsing URL
Best thing is these queries will generate interesting ideas of things you
could do for yourself.
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
is is what I was thinking of; I'll take a look.
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>, Bob Showalter
wrote:
> Kevin Pfeiffer wrote:
>> I occasionally see things in a script such as:
>> # $Id$
>>
>> I assume this is for some sort of automated version
>> identification? I use
>> use cvs, but end up having
more info?
-K
--
Kevin Pfeiffer
International University Bremen
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>, John W. Krahn wrote:
> "R. Joseph Newton" wrote:
>>
>> Kevin Pfeiffer wrote:
>>
>> > I'm looking at HTML::TokeParser. It expects a scalar with a filename or
>> > a reference to a scalar containing the
;, @html); # pass scalar ref to module
} else {
die "Usage '$0 [filename]' or 'datasource | $0'\n";
}
...with the same result.
-K
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>, John W. Krahn wrote:
> Kevin Pfeiffer wrote:
>>
>> In article <[EMAIL PROTECTED]>, John W. Krahn wrote:
>>
>> > You need to convert the IP address to a 32 bit integer and back again.
[...]
>> (But this includes num
In article <[EMAIL PROTECTED]>, John W. Krahn wrote:
> Kevin Pfeiffer wrote:
>>
>> In article <[EMAIL PROTECTED]>, John W. Krahn wrote:
>>
>> > my $string1 = 'C:\Program files\directory1\directory2\directory3';
>> > my $string2 = &
ue, "\n" ;
last if $value eq $finish_address;
if ($result[3] == 254) { # need to do carryover
my $x;
for ($x = 3; $x > -1; $x--) {
if ($result[$x] == 254) {
$result[$x -1]++; # carry over to next column
$result[$x] = 0; # reset column
}
}
}
}
print "\n";
__END__
(Comments, suggestions always welcome.)
-Kevin
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
= split /\\/, $string2;
my @diff;
for (0 .. $length) {
last if ($array1[$_] ne $array2[$_]); # avoid trailing /
push @diff, "\\" if @diff;
push @diff, $array1[$_];
}
print "Common path", @diff, "\n";
-Kevin
--
Kevin Pfeiffer
International Univer
If I try with a gif, I get:
sputnik:~/perl/pdf -> ./new_report > report-new.pdf
image 'balloon.gif' has unknown format with signature '474946383961' at
/usr/lib/perl5/site_perl/5.8.0/PDF/API2/Image.pm line 75.
I've looked at the various modules (Gfx.pm, Image.pm) but see
In article <[EMAIL PROTECTED]>, Paul
Johnson wrote:
>
> Kevin Pfeiffer said:
[...]
>> You'll see there is a "1" after the 'speak' routine's output (each time).
>> I can't see where the "1" comes from.
>
> Your speak meth
mmm ohhh well ahem);
$sound[rand(5)];
}
sub sound2 { "..." }
}
And I then write:
my $john = Person->new("John");
print $john->speak("Hello");
This works fine except...
sputnik:~/-> ./animals
John says, "Hello"!
1sputnik:~/->
Y
een each word there.
One "quick and easy way":
print "@foodlist\n\n";
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
array = @array[ map abs(), -$#array .. 0 ];
>> print( join("\n", @array), "\n" );
>> Ctrl-D
>> 5
>> 4
>> 3
>> 2
>> 1
[...]
> *Vey* cool examples--especially the 'map' in the first one.
>
> Thanks!
>
> Paul
Oh yeah, I'd really want to learn map before reverse... ;-)
-K
--
Kevin Pfeiffer
International University Bremen
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
e one inner reference..."
warning. Adding "undef $t" before the untie cured it.
Seems to be a useful module.
--
Kevin Pfeiffer
International University Bremen
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>, Vema Venkata
wrote:
> Hi Dan
>
> The problem still persisits pls. help/suggest me what to do ?
Try comp.unix.admin
--
Kevin Pfeiffer
International University Bremen
A: Because it messes up the order in which people normally read text.
Q: Why
ewlines & tabs).
No need to filter twice I think (also from perldoc -f split):
print "$_\n" foreach (split / */, uc $name);
Only 505 unread messages to go... :-\
-K
--
Kevin Pfeiffer
International University Bremen
A: Because it messes up the order in which people normally read text
s
>
> my $t1 = str2time("12/08/2003, 11:00");
> my $t2 = str2time("13/08/2003, 23:00");
>
> my $hours = ($t2 - $t1) / $hour;
I just tried this (as written) and $t2 is not initialized. Any ideas why?
(whoops, I think I know: locale)
If I change the second da
ll necessariy have
> a sort command and if it does -u may have a different meaning or it may
> not exist at all.
No, I'm not suggesting you use it, just comparing it with its replacement -
on my command line typing "sort -u myfile" produces sorted output (as well
as elimin
x27;t use strict; complain about @set?
Heh, I think I just posted about this. Unless my memory deceives me,
"@set{ @arr }" is a hash slice. That is, it's really %set (in 'batch' mode
;-)), which you have declared. I remember this because it seemed so strange
at the time.
ch different is:
my $file = 'file.txt';
{
open my $fh, '<', $file or die "Cannot open $file: $!";
my %seen;
my @unique = grep {!$seen{$_}++} <$fh>;
}
(Or, what does 'do' do here that I, too, should do 'do'?)
Hmmmm, looking at
quot;... (was in the book 'Hundred and One Uses for
"@", "%" and "$"').
-K
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
re you thinking of a simple command line menu?
*** Welcome to My Menu ***
Today is Wednesday
Users logged on:
1)pfeiffer
2)nobody
CWD: /home/pfeiffer
**
User to kill (enter #):
;-)
If so, think about:
perldoc -f write or
perldoc -f printf (I thi
found for this URL. Could you correct and repost as this is
> something I'd be interrested in.
Try it with a tilde (he said): http://www.linux.lk/~anuradha/
http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mai
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote:
[...]
> unless ($input =~ /^[^\D]+/ or $input eq '') {
While messing around with the valid '' input problem I see I obfuscated the
regex. I think this will do just fine:
unless ($input =~ /^\d+/ or $input
");
$intel_num_procs = join (" ", "-n", $num_procs) if $num_procs;
sub get_input {
my $prompt = shift;
my $input =''; my $err_cnt = 0;
{
print $prompt;
chomp($input = );
unless ($input =~ /^[^\D]+/ or $input eq '') {
die "Invalid input, exiting\n" if ++$err_cnt > 2;
redo;
}
}
return $input;
}
-K
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
routine needs to always come
first -- or be in a BEGIN block?
Thanks all!
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
4 2003
perldoc -f localtime
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
ch (@array) {
my ($key, $title, $url, $code) = split /\|/;
# do other stuff...
}
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
someone else will find this useful)
-K
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I posted to the O'Reilly errata page for this, but have not seen an answer
yet. Has anyone else found the referenced code from the new Learning Perl
Objects, References, and Modules book?
-K
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED
$on and not $off;
$on++ if /line2/;
}
__DATA__
This is line1
some text on line2
line3 all about me
good stuff on line4
line 5 isn't that great
I'm on line 6
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
m sure someone can do this more elegantly):
if ($line =~ /[^(]*\(([^)]+)\)[^(]*\(([^)]+)\)/) {
print "$1 and $2\n";
}
--
Kevin Pfeiffer
International University Bremen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
1 - 100 of 166 matches
Mail list logo