--- [EMAIL PROTECTED] wrote:
> Ok, I got sorta a hard question that involves
> calling randomly changing subroutines.
Hmm... instantanously the security alarm bell sounds.
> What I'm trying to do is this. 5 libaries are required
> into my CGI(PERL) program. Each of them has their own
> set of
--- Konrad Foerstner <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I have some problems with the Chart::Plot modul:
>
> I started to use the module
> (http://www.speakeasy.org/~cgires/modules/plot/plot.html)
> to make some plots. Without any modification I get nice plots,
> but when I use setGra
--- Sven Bentlage <[EMAIL PROTECTED]> wrote:
> I'm just looking at Matt's wwwboard.pl
Look at: http://nms-cgi.sourceforge.net/
in particular the top of the page:
nms as recommended by Matt Wright
-
...
While the free code found at my web site ha
--- "Kipp, James" <[EMAIL PROTECTED]> wrote:
> Could someone enlighten me on when it is necessary
> to chomp an array. It seems when i write scripts
> that have a foreach or a while to iterate through
> an array sometimes the chomp is necessary and
> sometimes it is not.
chomp(@array); # What
--- "Jackson, Harry" <[EMAIL PROTECTED]> wrote: >
> I have been looking back at this problem and here is what I have found.
>
> Lets take the following set of times
>A , B
> 1 (4 , 5)
> 2 (9 , 10)
> 3 (11 , 12)
> 4 (12 , 14)
> 5 (12 , 18)
> 6 (14 , 15)
>
> If
> I've got two machines here which are pretty crappy but there seems to be
> something seriously wrong somewhere. One machine, a Pentium 200 MMX
> with 80MB ram runs a very simple script taking 5 seconds.
*Drool*
I have three 486/66 machines with 16Mb ram, that are on my home LAN. I log
into t
Oops, redirecting to:
[EMAIL PROTECTED]
Jonathan Paton
=
s''-//--/\\///|-\/\|--\--/-\-/\-//\-|/\\\|/\///|-\--',
s''/-\\\/|///|-|/|/--\--/--//\|\/\||/|/-/\\\-/\///|-\-\-',
y'|\/-'3210',$_=join qq\\,map{s|2|10|||s|3|11|||s|^|0|;$_}
m|.|g;map{print chr unpack'N',pack'B32','0'x24 .$_}/.{8}/
> (Please correct me if this is the wrong list for my proposal.)
Treasure Hunt for it:
http://www.cpan.org/
there is one, even if it is [EMAIL PROTECTED]
> I was wonder if it would be possible / usefull to add a hibernation
> functionality to the Perl 6 Language, possibly via a Module.
> (but
> You mention checking out perlref in the perldocs - I'm familiar
> with "perldoc -f keyword", but how would I find information on
> these things if I didn't know the keyword "perlref"?
I can't find any email answering this question:
perldoc perl OR
perldoc perltoc
isn't it so
> Okay, I've repaired it - it now works fine under warnings and strict.
> Almost all my code is written for strictures, I just posted my code
> in an intermediate form without having debugged it. I think it still
> isn't working right, as the answer given is 6 but I reckon it should
> be 7!
Hi g
$refStart = $start[$i];
> $refStop = $stop[$i];
> $hash{$refStart} = $stop[$i];
> }
> }
>
> foreach (sort { $a <=> $b } keys %hash) {
>print $_, " ", $hash{$_}, "\n";
> }
> #
--- [EMAIL PROTECTED] wrote:
> No. you have 11,12 as 2 when only 1. Right?
>
> Wags ;)
Oops, yeah. I guess I made it easy for you to spot,
could do something about the complexity, couldn't you?
O(length of total timeframe)
isn't exactly hot. I'm looking at Shishir K. Singh's
algorithm
--- [EMAIL PROTECTED] wrote:
> What we have is as stated a union of times. So all I do is take the
> timeslices and generate a hash element for each time. I don't check to see
> if it is already there, but just set to one. Then I sort the hash down
> numerically and total where current minu
> >> I want to write to a file all of the array(@data), except the first
> >> field
> >
> >@data[1..-1]
> >
> >means the array @data from element 1 to the last element.
>
> Sadly, Perl does not support that syntax. Ranges must be
> low..high. @foo[1..-1] doesn't work.
Jonathan throttles th
--- Ned Cunningham <[EMAIL PROTECTED]> wrote: > Snip
>
>
> open CUST, $cust or die "Cant open it :$!";
> open WRFILE, ">$wrfile";
>
> while (defined ($line = )) {
>
>
> chomp $line;
> @data = split(/\|/,$line);
> $newnum=$newnum+1;
> printf WRFILE ("0%9d",$newnum);
>
> print WRFILE ";", @da
--- Pete Emerson <[EMAIL PROTECTED]> wrote:
There is a hackish tendancy when referring to the 'use' keyword
to use the form:
use confusion;
why? Because it is Perl's way of loading modules - this would
be a pragma (like strict and warnings). Of course, we need to
get you to use:
no confusio
> > I'm trying to come up with an algorithm that seems like it ought to be
> > really easy, but it's turning out to be pretty tough...
> >
> > Basically I have three pairs of start/stop times, e.g.:
> >
> >3, 5
> >4, 10
> > 15, 20
> >
> > I want the total time covered by all these ran
> my @sorted = map { $_->[0] }
^^^
delete this... might help
> sort { $a->[0] <=> $b->[0] # Sort by element 0
> ||
> $b->[1] <=> $b->[1] # then by element 1
> }
> @
> I'm trying to come up with an algorithm that seems like it ought to be
> really easy, but it's turning out to be pretty tough...
>
> Basically I have three pairs of start/stop times, e.g.:
>
>3, 5
>4, 10
> 15, 20
>
> I want the total time covered by all these ranges. I can't just s
> >> -Original Message-
> >> From: F.Xavier Noria [mailto:[EMAIL PROTECTED]]
> >>
> >> What would be the shortest code that leak?
> >
> > Its not really the length as much as the width
> > of the whole that causes a leak.
This challange is now being covered on the golf
mailing list. I ca
> > Is it possible to return elements 2 (index 1) thru end of the results of a
> > split?
> >
> > @myarray = (split(/\s+/,$fContent[$i]))[1..-1];
> >
> > seems right, but doesn't work...
It seems right to me too, however, I bet you are getting an array out of
bounds problem. First line is bl
> % Well, if the merchant has his own cipher key, it can all be encrypted
> % with the owner's cipher key. That make sense?
>
> OK, I think so. I like examples, though.
>
> So user Joe goess to https://myserver/script and fills in some values,
> including his ccard no, and they get handed back
--- drieux <[EMAIL PROTECTED]> wrote: >
> On Tuesday, May 28, 2002, at 05:27 , Jonathan E. Paton wrote:
> [..]
> > Never rely totally on software based security. There is no point
> > installing/writing lots of security software if your system admin is
> &g
--- Langa Kentane <[EMAIL PROTECTED]> wrote:
> Well, reasonable security is fine, but the idea of writing
> zeroes to the file does not appeal to me, If I can't get
> any other way I guess I will have to use that.
Allow me to assume you are using Unix... you have a hopeless
cause if you are usin
--- Nikola Janceski <[EMAIL PROTECTED]> wrote:
> I think if you want the file contents to be completely
> UNRECOVERABLE you must.. MUST change the contents of the
> file to some value other that it is... I just usually fill
> the file up with ZEROs until the size is the same as it
> orginally was
> > Greetings,
> > How would I go about shredding a file with perl, for instance, I have a
> > script opening a time file, writing something in there and then deleting
> > the temp file when execution is done. How would I go about securely
> > deleting the temp file afterwards so that prying eyes
> d> while() {
> d> # grovel through the email message
> d> # get what you want out of it
> d> # also should note any spam sent this way to
> d> # counter spam them so as to prevent webCrawlers
> d> # and s
"Subject: My name is ?"
That's easy, your name is José Nyimi ;-)
> How can I tell my script to get the complete
> name of the file where this script is written?
>
> I can write something like:
>
> #!/usr/bin/perl -w
>
> use strict;
> print "My name is ",__FILE__,"\n";
> __END__
Ah, you mean:
--- "FLAHERTY, JIM-CONT" <[EMAIL PROTECTED]> wrote:
> I have a test maker script, that generates random questions
> from a DB. My grader script needs to grade those same
> random questions
Read, and then repost with a more specific question, one that
does not take 2 hours or more to figure out
> Can someone please tell me, how can I read the input
> send to perl from the .forward file?
You *may not* want to do this, as a perl intepreter
will be launched for EACH and EVERY email that is
received. This could destroy system performance if
you receive a lot of email, but I guess you don't
> Why is the addition of the numbers -67947269.62 and
> 68288455.49, both with only 2 numbers after the decimal,
> resulting in 341185.8696 where there are 8 numbers
> after the decimal. I would expect the number to simply
> be 341185.87. How can I avoid this strange behavior?
Because "floa
--- LoneWolf <[EMAIL PROTECTED]> wrote:
> I am wanting to write a script to handle a few things
>
> 1. decrypt an encrypted password
Easy, as long as we may assume you've got several hundred
years of CPU time!
Jonathan Paton
=
$_=q|.,&@$$. ,.@$&@$. .&$$@. ,,$ !$_=$p.'&$@.',y'&$@' .,';f
--- Ron Powell <[EMAIL PROTECTED]> wrote:
> I was recently reading Linux Administrators Handbook (by the
> same folks who wrote Unix System Administrators Handbook)
> and it mentioned that you could write a perl script to add
> users, set their passwords, etc.
>
> The question is, could someone p
> I will be getting the files from different platforms
> (i.e. Unix or Windows). Is there a way I can automatically
> detect the line endings and accordingly use the chomp
> function to remove it.
You need to remember Mac's have Yet Another Newline Sequence,
which makes the whole exercise ra
> ...and then Grace Lontok said...
> %
> % Thank you for your rudeness. I already sent 5 e-mails to the
> % unsubsribe link at the bottom of the messages. However, I
> % continued to receive mass e-mails for quite some time and so that
> % is why I e-mailed the entire list serve. I apologize
> This may sound as a very stupid question, but here it
> comes anyways. Has anybody come across a function that
> would calculate the power of a number, like the pow
> function in C. Simply, x to the power of y.
Yeah... I've come across one before. I'll take this
oppertunity to gently remind yo
> My problem is this:
>
> I'm taking the results from a hash search (that determines if a particular
> student name and password combination is valid) and passing it to another
> hash search (which is part of an if loop), which is supposed to print out
> the assignments for the student. That wor
> Could anyone point me to a good tutorial on how to do this or give me some
> simple examples. I have read some of what is in Advanced Perl programming
> book. But unfortunately I am pretty new to perl and I don't know jack about
> C.
perldoc perlembed - contains some simple examples... for ce
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
> ...
> %byname = reverse %hash;
Thanks John, that was the concise way to do it. Time
for someone to do the benchmarks between this and the
"while each" method I did.
I *think* the latter will be faster (or at least less
memory hungry) - but perha
> any ideas on how to create reverse hash quick?
> ...
while (my ($key, $value) = each %hash) {
warn "Collision during inversion!"
if exists $hash{$value};
$new_hash{$value} = $key;
}
of course, if you are doing this a lot then you
need a different structure. The solution is
obv
--- Arran <[EMAIL PROTECTED]> wrote:
> Does perl support DDE by any chance (eg communcation with MSword ect)
>
> Dont bother telling me if im going to have to use API
I'd better not bother telling you... every interaction
with another application requires an Application
Programming Interface (A
> > Would something like this work? Is there a way to get it working?
> >
> > print (&test);
Caution:
print (1 + 2) * 3
!=
print +(1 + 2) * 3
because of the rules of precedence.
As per Paul's reply... what exactly is the question?
Jonathan Paton
___
> Clearly, in the real usage you'll capture and not use $&.
Just in case that's not clear to beginners... one use of
either $&, $' or $` will flush regex performance down the
pan for your whole program. See page 146 of Programming
Perl (3rd Ed, "Camel"). Best to avoid in anything but
trival pro
--- "Beau E. Cox" <[EMAIL PROTECTED]> wrote:
> Gee whiz - All I wanted were comments on the book...
> Has anyone out there read it?
One day I was out walking in the woods... carrying a
basket of food for granny... when I stumbed across:
http://learn.perl.org/
there is a pair of book reviews, i
--- Timothy Johnson <[EMAIL PROTECTED]> wrote:
> I find that subtleties like Paul's are lost on the
> majority of users and programmers alike out there.
> I prefer the more direct method of:
>
>
> ##
--- Timothy Johnson <[EMAIL PROTECTED]> wrote:
>
> And there's always those days where you start sending out emails with
> semicolons at the end of the sentences. Yesterday I even caught myself
> writing code on a piece of napkin on my lunch. I'm afraid the day will
> finally come where I star
--- drieux <[EMAIL PROTECTED]> wrote: >
> On Thursday, May 16, 2002, at 11:14 , [EMAIL PROTECTED] wrote:
>
> > Hello,
> >
> > is it possible to determine within a function from which
> > module/function this one was called?
>
> perldoc Carp
>
Not quite Drieux, but close (depending what it is
> I'm working on Unix (solaris)
> I want to set the coredumpsize to 0
>
> On shell (Csh) we run
> limit coredumpsize 0
ln -s /dev/null core
just stick into any directory where you could
have a core dump. You must be doing something
mission critical to be desperate to stop these,
but not missi
> The first two steps are fine. Problem is, when I come the next step:
>
> [ot@papc-mag-17 Tk800.023]# make tkperl
> make: *** No rule to make target `tkperl'. Stop.
>
> Any ideas? Thanks in advance.
Verify you need this... usually everything is build with just 'make'.
If the documentation say
> I see a number of mails about Perl books. Most of them
> mention the O'Reilly Books. Does anyone use Perl in a
> Nutshell? Is it any good as a reference book?
I have this particular book, however I feel that a certain
amount of content rot has settled in. My version (latest?),
was printed in
> Assuming I used unique variable names throughout my entire program, then is
> if correct to say I don't need to declare function variables with 'my'?
use strict;
Always, always, declare your variables with my.[1] What do you mean by "function"
variables? If you are suggesting "pass by global
> > A hardware device connects to the socket and sends characters (barcode
> > scanner output, variable length, alphanumeric) followed by '/r'
> >
> > My (very basic) understanding is that if it used '/r/n' my code would work.
Okay, sounds like you need to:
Read with newlines as /r, change to
> Please help me. I am trying to do pattern matching for an IP address. I have
> tried the following and it does not work:
> unless ( $ip =- /[0-223]\.[0-255]\.[0-255]\.[0-255]/ )
> {
> die ( "Invalid IP\n" );
> }
> print ( "Valid IP" );
>
> Is there a way I could
> ooopss!! i was wrong ... $^O worked
>
> According to "perldoc perlvar" :
>
> $^O The name of the operating system under which this
> copy of Perl was built, as determined during the
> configuration process. The value is identical to
> $Config{'os
> I've never used perl2exe, I don't know much about it, but are
> you 100% sure the interpreter isn't available? That'd make
> every eval{} invalid... and certainly a lot of code uses it.
>
> Try compiling code with:
>
> eval { print $^O }
>
> and see what happens.
Opps, change {} to "", ev
> Is there a module, using which I can determine the Operating
> System on which my perl script is running? I cannot use $^O
> as the my script will be an executable (using perl2exe)
> and therfore the interpreter won't be available during runtime
I've never used perl2exe, I don't know much abou
> may I recommend that you start with trying say:
>
> $hash{1} = [@array1];
>
> or
> my %hash = (
> 1 => [@array1],
> 2 => [@array2],
> );
Be aware there is a difference between:
[@array1]
and:
\@array
because the former flattens the array, and
> How do I access a field in an array that is a field of a hash?
> ex:
> %hash
> $hash[1] =@array1
> $hash[2] =@array2
> .
>
> now I want to change $array2[6] via the hash.
The syntax is wrong, you use {} for hashes... and you wouldn't
normally use numerical indices. Also, you need to take
> > Note that 'use vars' is supposedly depreciated, so don't
> > use it if your script depends on 5.6 features. Placing
> > 'our' in a lexical scope probably makes it externally
> > visible until you leave the scope, 'use vars' imports
> > into your symbol table. Hope this is right :)
>
> That'
> > Yes you can say
> >
> > our $opt_m;
> >
> > or
> >
> > use vars qw($opt_m);
> >
> > at the top of your program (depending on perl version).
>
> I've been preached the orthodoxy of the later - but
> have never understood the distinction...
>
> Yes, have read coping with scoping.
>
> anyone h
> > Yes you can say
> >
> > our $opt_m;
> >
> > or
> >
> > use vars qw($opt_m);
> >
> > at the top of your program (depending on perl version).
>
> I've been preached the orthodoxy of the later - but
> have never understood the distinction...
>
> Yes, have read coping with scoping.
>
> anyone h
> >and hence the magic of using single quotes doesn't work as you'd expect.
> >It does get you out of other trouble though:
> >
> >s'$%@|'replacement';
> >
> >where you'd otherwise spend all day backslashing things.
>
> All single quotes do is stop INTERPOLATION. Interpolation is not the
> issue
> > Oh yeah makes perfect sense now...match nothing or nothing and sense
> > everything has nothing it always matches. haha...I like that.
> >
> > Tanton
>
> I guess the two HORRORS I would like to stomp on are
>
> a) using "|" as a delimiter
Everyone should be using the standard CSV nota
> > Looks like that question has been quite well covered.
> > Under Unix, my simple version can be reduced to:
> >
> >cat list.current | perl -ne 'print if not $seen{split'|'}++' > list.new
>
> Not so.
Had you fooled for a moment!
> First, you've got quote problems.
Doh! I'd prefer to change
> >>I am using it as a mailing list. However, over the last half year, it has
> >>gotten pretty big, and has some duplicates in it. For reporting sake, I
> >>would like to delete the duplicate records based on email addresses. If you
> >>sign up three times, I only want to keep your first recor
> I ran some tests and it looks like /|/ matches just about anything...what
> does /|/ mean?
If it were a regex, hang on... maybe it is... it would mean:
Match a zero length string OR a zero length string. | is the regex character
for OR.
Jonathan Paton
___
> I want this file:
>
> jones|Bob|Acme1|[EMAIL PROTECTED]|GA|2/25/2002
> jones|Bob|Acme1|[EMAIL PROTECTED]|GA|2/28/2002
> smith|Jan|Acme2|[EMAIL PROTECTED]|FL|3/1/2002
> johnson|Salley|Acmeshop|[EMAIL PROTECTED]|TN|4/5/2002
>
> SMITH|JAN|ACME2|[EMAIL PROTECTED]|FL|5/2/2002
>
> to change to this
> I have a lot of trouble understanding regexes, i just don't get how to parse
> a file with:
>
> "Hablar es el arte de sofocar e interrumpir el pensamiento". Thomas Carlyle
> (1795-1881); historiador y ensayista escocés.
> "Se aprende más por lo que la gente habla entre sí o por lo que se
> sobr
> I need an example on how I can script lynx to send me
> an e-mail of a list of stock quotes every so often.
Lets get this straight:
1. You want to script to interact with a web browser
2. You want the web browser to send an email
3. You want this done periodically
Hmm... not sure what lynx ha
> Yeah, Tony your sturcture worked fine... except
>
> system "tar cvf ./test.tar *.grib"
> if ($? == 0) {
> print "\nSuccess!\n";
> }
> else {
>print "\nUnsuccessful!\n";
> }
Perl programmers are lazy, and don't use things like '== 0' almost 100% of the time.
The
following
| > What if I change my name to a symbol (like the artist formerly
| > known as Prince)?
| >
| > Some ideas for my new name:
| > rm -rf *
| > /dev/null
| > pop @women
| >
| Then you'll be tarred and feathered and run out on a rail. :)
Too much validation in a single regular expression is a bad t
> I am supposed to parse a text file such as this-
> 781457 Hartanto Victor Setiawan <[EMAIL PROTECTED]>
> 777557 Hatfield Benjamin <[EMAIL PROTECTED]>
> 779777 Henry James <[EMAIL PROTECTED]>
> 777947 Hergert Michael William <[EMAIL PROTECTED]>
> 778097 Iverson Jennifer Marsee <[EMAIL PROTEC
[Cross-posted reply to cross-posted article... to avoid]
[further duplication only '[EMAIL PROTECTED]' should ]
[be used for further correspondence on this thread.]
[Remove PBML from the header before replying! Jonathan]
Hi,
Please don't cross post questions between PBML and [EMAIL PROTECT
> I would like to create a unique list.
Buy the Cookbook or search the archives, since this is a common
question. Basically one of the following two solutions is best.
%seen = ();
@unique = grep { not $seen{$_}++ } @list_A, @list_B;
OR:
%seen = ();
$seen{$_}++ for @list_A, @list_B;
@unique =
--- Deb <[EMAIL PROTECTED]> wrote:
> Hello,
Hiya!
> I installed perl module Text::Reflow on perl v5.6.1 for Solaris.
>
> It built fine, but "make test" fails in that it hangs on the
> first test.
Okay, try again... does it still fail? If yes, then download the
module manually and follow th
> >>
>http://www.wetware.com/drieux/CS/lang/Perl/Beginners/BenchMarks/complexArrayHash_v_loop.
> >> txt
> >>
> >> for the details on the comparison
> >>
> >> looks like the double loop is faster but it may not be
> >> in some other configuration of data...
> >
> > The dereference is proba
> hence since we are playing the
>
> @hash{@keys_oh_hash};
>
> game we don't want to get that confused with the "->" component
>
>
>http://www.wetware.com/drieux/CS/lang/Perl/Beginners/BenchMarks/complexArrayHash_v_loop.
> txt
>
> for the details on the comparison
>
> looks lik
> > And also there is no need to quote hash keys, and if $inner is just a
> > hash reference then the
> > following is a shorter replacement:
> >
> > print join (" : ", $_->{qw}) . "\n" for @$cfgs;
>
> I have not been able to get any variant of this to work.
Try this FAR simplier case, which do
> Did you try it? You are right, the second foreach is totally redundant.
>
> > foreach my $item ( @$cfgs )
> > {
> > foreach my $inner ( $item )
> > {
> > print "$inner->{'dir'} : $inner->{'tpl'} : $inner->{'ext'} :
>$inner->{'rgx'}\n";
> > }
>
> The only effect the second
> > Don't forget to turn on autoflushing with "$|=1", or for long queries
> > it will timeout.
>
> Thanks for the tip. I guess I will find information about it in man DBI?
Opps, forgot to say that is a CGI issue.
Others have been explaining that one for yonks, try a google search on
"CGI Perl a
> Now the code:
> #!/usr/bin/perl
> use Strict;
> use CGI qw(:standard);
> use DBI;
Honour deserved for using 'strict', but you have forgotten
to enable warnings. Strict ***MUST*** be lowercase otherwise
on systems with case-sensitive filenames it will barf.
> my $dbh = DBI->connect("DBI:mysql
> The script is not smallish, but the main loop looks like this:
>
> {
> # Connecting
> $dbh = new Sybase::DBlib $userid, $password, $host;
> $dbh->dbuse($database);
>
> # Checking
> checkProsesses();
> checkSegmentStatus();
> getMonitor();
>
> # Disconnecting
>
> I've created a script that is checking the status of an ASE-server.
> It's running in an infinitive loop:
>
> 1. Connect to the database
> 2. Doing some checks...
> 3. Disconnecting from the db
> 4. Sleeping for avile
> 5.
>
> I found that the perl prosess is using about 4
> If anyone is good in Java or can tell me where I
> can get help find for the following it will be
> much appreciated.
We are the Perl beginners list, not the Java list.
> I'm not entirely sure where I start.
> ...
James, I'm trying hard to stick to a small flame
for what deserves a massive fl
> > I got this problem from a friend and was wondering if anyone could help
> > out.
>
> And quick, because it's due in soon.
>
> PS. I'll be posting this every day until someone answers it for me^Hy
> friend.
>
> ;-)
Thanks Paul for stating the obvious :) Commonly accepted list etiquette
su
> > Did someone know it is possible to transfer data between perl and java
> > interface without file transfer? I want to print data to the java
> > interface instead of the konsole(linux).
>
> I think this is going to be implemented in Perl 6... but don't know if it's
> possible in Perl 5.
Go to
> > I'd like to create updating dns and user and password under web.
> > but I don't have suid so I cannot change the file or running binary file
> > that use root permision...
>
> let's have that little coffee break moment here and think about this.
>
> Have you throught about the 'security' is
> Here is my current situation. I have got a time consuming
> query to the database. After prepare the data, I should
> post those data on to a html page. But the problem is the
> accessing time is too long and the browser is going to be
> time out.
Hi,
Why not explore the tangent solutions...
> I've been teaching myself Perl and C in preparation for a new job. I've been
> using Wrox's "Beginning Perl" and the Camel book for Perl, and K&R and the
> Deitel&Deitel "How to program " for C. Does anyone know of a Perl
> instruction book/web resource that has plenty of exercises (with example
> what do these few matches with?
Please don't ask homework questions on the list, unless you
need something particular explained. Especially with regex's,
as the best way to describe the complete set of matching
strings is another regex (or more likely, the same one).
> m/(ham|cheese|Big Mac)
> I need to back up two days from localtime and I can't
> figure out how to do it. Currently I'm doing this just
> so I can work out the rest of the program:
[Ignore me if you aren't on a Unix like platform]
Hi,
You should seriously consider installing the 'at' job
manager for run-once tasks, o
> You are running Perl version 5.006
> We strongly suggest to upgrade to at least 5.6.1
> Reading Makefile.PL args from @ARGV
> Unable to determine server version, aborting
> Please specify MP_APXS or MP_AP_PREFIX
>
> To make matters worse, rpm -q perl tells me I'm running perl-5.6.0-12,
> quite
> I am very new to Perl and to computer programming in general, but
> have been amazed at all the cool stuff that it can do. Recently I've been
> working on a program to run loops of S-plus scripts. I can get the program
> to run 1 s-plus batch script but when it attempts to run multiple s
> >> The suggestion of:
> >>
> >> if($something =~ /^(string0|string1|string2)$/)
> >>
> >> is not equivalent to your original condition. It's also likely to be
> >> inefficient.
> >
> > I get 1 min 15.983sec for "normal" three condition if, and 52.305sse for
> > a regex approach. My
> > test c
> > Is there a better way to simplify the syntax when testing for multiple
> > conditions?
>
> Your original code is the proper way to do it. All the other solutions
> proffered are inferior, IMO.
Use 'or' and 'and' to remove clutter, they have different precedance and
are often useful in this c
> Is there someway to get the line number of
> whence a subroutine was called?
Yes, but 9/10 ten people use Carp.pm, the
other 1 respondant was an assembly language
programmer.
perldoc Carp
Carp is implemented using 'caller', which
you can find documentation about at:
perldoc -f caller
If you
> > 2. When I turn on my PC, I'm promped to choose a OS:
> > Win98 or WinXP. XP doesn't work. So how to remove
> > this prompt and run always Win98?
>
> I suppose you could try either editing your boot.ini or
> replacing ntldr and boot.ini with the correct versions
> of io.sys, msdos.sys, and aut
> re:Have you got the hex code for that one? I presume this is the only
> > character causing difficulty - hence we really want to avoid turning
> > the whole string into hex numbers - which are harder to process.
>
> $values = unpack('H*',"$file");
>
> output for the entity â~@¢
>
> HEX: e28
> I should have been more specific or maybe I have missed the point again :(
> the file is UTF-8 encoded which is fine for what I want.
>
> However, I need to get at bullet points within the text. these apear as the
> entity â~@¢ in vi.
Have you got the hex code for that one? I presume this is t
> I am trying to convert a file into hex from text
> with a view to doing some manipulation before
> turning it back to text.
One has to ask: WHY???
(Unless using tools that already exist)
Perl can handle both text and binary information,
and you can do all your binary manipulations as
if you we
1 - 100 of 335 matches
Mail list logo