Hello Jakob,
> I'm trying to create a script with where you can put a flag to the script
or
> not
> fx run it like:
>
> script -h
> or just
> script
I would use one of the Getopt::* modules, because parsing command line
options is something very standard, and as you add more and more options,
th
Hello Greg,
> Thanks for you comments. Is this the best way then? Seems to work, but
I'm
> curious what could be any better..
Your version is fine. Here's mine, just so you have another take on how to
do some things. Among a few other things, I added checking for so that the
guess has to be a
Hello Romain,
> sub n_list {
>
> my($a)[EMAIL PROTECTED];
>
> ...sql query...
>
> my $sth=$dbh->prepare($sql);
> $sth->execute();
>
> my node_l;
As others have noted, this should be @node_l, but you say it's that way in
your code (why didn't you just paste your code btw? Would have avoided su
Hello Joseph, David,
> A stronger argument has to do with mindset. The || operator is an
> expression evaluation operator, appropriate to mathematical or
paramathematical
> expressions. The context really calls for a flow-control operator, or.
Thanks for making my point better than I could, Jos
Hello Joseph,
> One thing I would request is that you trim off any material to which you
are not
> responding from old posts. This helps keep bandwidth and storage needs
down.
I'll keep that in mind. I usually don't keep all the thread of replies that
Outlook ( grrr) keeps at the bottom, seems l
I am sorry David, it just seems like I am having trouble communicating
clearly. We are apparently in a disagreement, but your points are not at all
what I wanted to explain... I'll try again.
> you should test it yourself. i am not sure how good you are
> with Perl and i
> don't want to sound lik
Hello Derek,
> can I email you from know on??? : ) You are so through! Thank you!
No, I would prefer that you always reply to the list. First reason is that
other beginners can benefit from our exchange (and the mails end up in a
searchable archive), second is that if I'm not there (or for th
> Guay Jean-SÃbastien wrote:
>>
>>> open (CRITICALSERVERS, "$crout") || die "can't open file \n: $!";
>>
>> As I said, you should replace || by or in the above line. See the
>> precedence rules in "perldoc perlop" for details.
>
> why do you think so? is there any problem in the above line?
The
t $line . "\n";
}
As you can see, it is very similar, but since we get the whole file into the
array, we can close it right after, and also we loop over the array instead
of looping and getting one line at a time until we get to the end of the
file.
Hope this helps,
Jean-Sébasti
Hello Derek,
When using strict, the error message should point you to the line where the
error is. It's usually pretty darn good at pointing the right line. In this
case, I bet it's this one:
>while ( defined($line = ) ) {
There is no declaration of the $line variable. Try declaring it f
Hi again Andrew,
> With the mysql driver, it does return the number of fetched
> rows before you start
> iterating through them. It does what I need it to do. Thanks.
Ok, but that behaviour is probably specific to DBD::MySQL, and can't be
relied upon if you change to another DBD... I would use
Hello Andrew,
> Is there a way to find out how many records were returned
> with a DBI query? There's the
> obvious counting each record as you fetch it, but I need the
> count before I start going
> through them.
I was looking through the DBI documentation (perldoc DBI) not long ago and
this
Hello Jason,
> $VAR1 = {
> 'oids' => '%response_values',
> 'time' => '03/25/2004 03:16:39'
> };
...
> If so, what is wrong with my assignment statement ?
>
> push @{$response_hash{$request_id}},{time => "$time",oids =>
> "%response_values"};
That is exactly what Charl
Hello,
> mike wrote:
>
> > When I do Search in the web-browser, is there any way to get it to
> > search the values in the fileds of the form?
> >
> > Currently all the values show up, but they dont seem to
> appear to be in
> > scope for searching
>
>
> Show some code -- likely your logic is
Hello Joe,
> i have the following code:
>
> $sth = $mysql_dbh->prepare("select subroutine_pointer from
> $database.equipment_manufacturer where
> manufacturer=\"$remedy_eqpt_mfgr\"");
> $sth->execute();
> $subroutine_pointer = $sth->fetchrow_array();
> no strict "refs";
>
Hello Mike,
> Do we know where I can get a clear definition
> of "query_string"?
[and in another message...]
> Is there any place we can look up the definition
> of these such as "CONTENT_LENGTH" & query_string.
I'm not sure why you're asking here for something like that. You can use
Google t
Hello Mike,
> $row=$dbh->prepare("SELECT contact_id,first_name,last_name,organisation
> FROM tb_contacts WHERE organisation ILIKE ?");
[...]
> while(($id,$first_name,$last_name,$organisation) = $row->fetchrow_array())
{
[...]
> $row=$dbh->prepare("SELECT id,contact_id,type_of_contact,priority
Hello Joseph,
>> String[] aStr = {"-e", "'print(\"Ola\n\") foreach
(1..100);'"};
>>
>> Process p = r.exec("perl", aStr);
>
> You told the system to open the perl compiler here. You may also have
Offered
> it 100 lines like this:
> "Ola
> ""Ola
> Which Perl would have a ver
Hello,
> It looks like not all of the fields have something in them. Perl is taking
blanks for
> undefined for some reason.
An empty field in a database is not a "blank", as you say, but a NULL.
Meaning it's not just blank, but effectively inexistant - there is no value,
not even the empty strin
> On Feb 20, 2004, at 2:02 PM, Joel wrote:
>> Thanks, can you give me some examples of loops like that?
>Here's one:
Nice code James, nicely reusable. Just need to add world file loading and
maybe support for items... ;)
But then all you have is a world in which you can move. What about actual
ga
> Not quite. There seems to be at least one extra step. With XP, you have
to
> call up a menu and select 'mark' before selecting. I can't recall at the
> moment whether you have to do menu selctions to paste at the insertion
point.
> In 2K, you can select text by dragging. If there is text sele
> [...] inclding copy-and-paste [though the XP version is
> intentionally more of a pain-in-the-ass than the
> W2K version, as with almost every professional
> aspect of the OS].
Err, not really sure what you mean by this. I have found it's precisely the
same in WinXP as in Win2k. Care to expl
Hello drieux,
> the upgrade will upgrade and install the
> XS compatible for 5.8.X version of the code
> for all of the components that are in the RPM.
>
> any additional perl modules that have an XS component
> will need to be re-built and installed.
Exactly, that's what I was wondering about..
> This should allow you to do an upgrade rather then remove and upgrade.
If it's possible to do that (and have it actually work), does that mean that
it's only on Windows (with ActiveState Perl) that Perl 5.6 and 5.8 are not
binary compatible for XS modules? If not, I would think that simply
upgr
Hello Kenton,
It depends on what you want to do. There is not really a "right way", since
the two series of statements you mention will lead to different results.
(I added numbers to the different parts of your examples, makes them a bit
easier to follow)
> if (expression1) {
> statement1;
> I've got the below script saved on my server - but every time I use it I
> get an Internel Server Error! I've set the permission to 755 but still no
> luck. Any ideas folks?
First of all, make your life easier with
use strict;
use warnings;
right after the shebang line.
Second of all, the si
> I don't know if this [specific] module is "standard"
> or not, but it was already installed on the servers,
> so I am guessing it is.
I don't think it is, or at least it wasn't installed by doing a full install
of ActiveState Perl 5.8 in my case. Perhaps the "real" Perl distribution
differs fr
Hello Jeff,
These answers are of course my own experience, but may be significant to
understand the bigger picture. I reorder your points a bit in my reply :-)
> So, why is it that most of the solutions represented
> in this group tend to point to a CPAN module when
> the code for it isn't that
> and may very quickly become
> outdated, then the amount of crud someone must wade through if they are
> one of the few that actually check the archive first has gone up greatly.
You've got a good point there. I didn't see it from that point of view, but
now that I do, I agree that this is not re
> I don't quite understand why the first response is sent back to the list
> rather than just the OP though?
Why do you send your responses (answers to questions) to the list instead of
to the OP? So that others can benefit, and so that it will be in the list
archives when someone else has the sam
> What rpm repositories does everyone use with ppm?
>
> The standard stock seem to be missing a lot of cpan modules.
> Thanks!
Here are a few I know of:
http://theoryx5.uwinnipeg.ca/ppms/ <-- many CGI/Apache/DBI/GD related
modules
http://www.roth.net/perl/packages <-- mostly Win32 related mod
Hello A L,
> When I search for this on the web, most of them give javascript results.
I would like > to use Perl. Is it possible to do this with Perl?
Why would you want to do something like that in Perl? When you click a
button on a web form, the only time you want to call a server-side script
my $integer = 432;
my $string = sprintf("%05d", $integer);
Yay!
J-S
-Message d'origine-
De: SilverFox [mailto:[EMAIL PROTECTED]
Date: 10 novembre, 2003 16:14
À: [EMAIL PROTECTED]
Objet: Playing with Numbers
Hi all, i'm trying to figure out how to test if a number is five digits and
if
> That's exactly what John said. ;)
I realized that 5 seconds after I sent the mail... <:-(
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> Which version of Perl from ActiveState did this show up in?
Well, seems ActiveState didn't really have to do anything after all,
according to John W. Krahn. As far as I remember, it's always been like that
in ActiveState Perl.
But as I said, I still find it great that they didn't do anything to
> It has nothing to do with what ActiveState did or didn't do. The
> DOS/Windows command interpreter (command.com/cmd.exe) uses '\' as the
> path separator however the operating system itself is able to use '/' as
> the path separator.
Err, just noticed I shouldn't have read so quick...
Still,
> It has nothing to do with what ActiveState did or didn't do. The
> DOS/Windows command interpreter (command.com/cmd.exe) uses '\' as the
> path separator however the operating system itself is able to use '/' as
> the path separator.
Sorry, I just tried it on my machine here (NT4), and doing
c
> I agree with your basic solution, but since he will
> be doing his development in Windows, shouldn't that
> be 'file system neutral'? hence not using the unix
> separator "/" between the directory component and the filename
> component?
In a move to simplify porting of scripts (and save the san
38 matches
Mail list logo