On Fri, 17 Dec 2004 15:23:35 +0800, Khairul Azmi <[EMAIL PROTECTED]> wrote:
Hi, start your script with:
#!/usr/bin/perl -w
use strict;
> sub get_conf {
> my $local_file = $_[0];
> my @local_conf;
local_conf is an array. An assosiative array in Perl, is called a hash.
You declear it with
Hi,
I am working on a function that would simple store value assignments
statement into an array. The statement is stored in a text file. The
contains of the file would be
---
var word1 one,two,three
var word2 four,five,six
---
So I write a function that would read the file and r
> Hi!
>
> Yes, you are near of the truth :). But if I use some complicated joining
> query to few large tables I think this is not too comfortable for the
> server.
>
>
Well, this is the line between mere programming and software
engineering.
The simplest technique is the most straightforwar
Dear Tim,
I think your code is on the right track, as I got a modified
version of your code working. I never use getc...
In C, where getc originates, the getc function returns a
char type. The C char type is almost always 8 bits long.
By definition it doesn't support unicode, so neither does
Pe
Hi!
Yes, you are near of the truth :). But if I use some complicated joining
query to few large tables I think this is not too comfortable for the
server.
Brian Barto wrote:
I just realized I was way off base from your original question. :) You want
to start over again from the beginning with fe
G'day...
I've got a function which checks that only allowed characters are
contained within a tainted piece of data, part of it looks like this:
if ($tainted =~ /^([$allowed_chars]*)$/) {
return $1;
}
Where $allowed_chars are the allowed characters. Questi
Hello Jonathan, all
> Not had the misfortune to need to play with this stuff, but I guess
> the documentation for perl is a good place to start:
>
[snip]
yes, i read these man pages more than just one time now (at different times),
so i think i should have not missed anything.
the perl-manpages
I just realized I was way off base from your original question. :) You want
to start over again from the beginning with fetchrow_array(). I think it's
just a matter of running the execute statement again to reset it...
-Original Message-
From: Nicolay Vasiliev [mailto:[EMAIL PROTECTED]
Sen
I don't think there is a way to make fetchrow_array() reverse the sequence
in which it delivers data. You can always store the data in a variable if
you need to use it later. Otherwise, if you are receiving rows of data from
the database in an order that makes it hard to work with you may want to t
Thanks Jonathan and Bob! From studying both your answers (for quite a
while), I actually get what this code is doing.
You guys are awesome. (I'm a newcomer.) Hope to give back some day...
Bill
-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 1
Hi,
Not had the misfortune to need to play with this stuff, but I guess
the documentation for perl is a good place to start:
perldoc perl
Particularly:
perldoc perluniintro
perldoc perlunicode
Some aspects are version dependent, so make sure your script
insists on a minimum version of perl.
W
Bill Adams wrote:
> Hi All,
>
> I've inherited a perl application. Can anyone explain to me the code
> below, particularly "find sub {"
>
> find sub { $chambers{$_} = $File::Find::name . "/passwd" if -r
> $_/passwd"}, @ARGV;
Jonathan gave you a detailed answer, so I'll add just a bit more.
Th
> Can anyone explain to me the code below ...
>
> use File::Find;
perldoc File::Find
> @ARGV = '/var/yp/src' unless @ARGV;
If no files are specified, then pretend we got /var/yp/src.
> my %chambers;
Create a hash called %chambers.
> find sub { $chambers{$_} = $File::Find::name . "/passwd" if
Hello there!
I have some dataset got by the executing of some query. For example:
my $sth = $dbh->prepare('select * from sometable');
$sth->execute();
Going through this dataset by $sth->fetchrow_array() I need to go back
inside this proccess. Sorry, but I have no idea how can I do this. How
can
Hi All,
I've inherited a perl application. Can anyone explain to me the code
below, particularly "find sub {"
TIA, Bill
use File::Find;
@ARGV = '/var/yp/src' unless @ARGV;
my %chambers;
find sub { $chambers{$_} = $File::Find::name . "/passwd" if -r
$_/passwd"}, @ARGV;
--
To unsubscribe, e-m
Hello,
i have intensively searched the web for a solution on the following problem,
but could not find any indication for it.
The following code does basicelly nothing else then reading in a file on single
char basis and writing it to a file again. The input file is encoded as UTF-8
as well as
Christopher Spears <[EMAIL PROTECTED]> wrote:
: Here is the latest version of my script:
I think you are using the wrong approach to parsing
this output. You're making it a lot more complicated
than it needs to be. I omitted the report and question
sections. Your report data is in %licenses.
>
> I'm certain that a tiny 'attempt to connect to the server on
$ENV{DISPLAY} and do nothing' program can be written.
>
File this under "ugly but works"
.. BEGIN PERL PROGRAM ..
#!/usr/bin/perl
use strict;
use warnings;
my $message = `xlsfonts -f
> > is there a way to make a perl program find out whether a
> > valid X-Server is running?
> > I.e. $ENV{DISPLAY} is not a dummy address, if set.
>
> In the situation you want to use X if available, terminal
> otherwise, wouldn't it be better just to use an option?
>
Well -- from a human-issues
Jonathan -
thanks for the input. Actually I wanted to provide more details but I
thought there would be a simple and standard solution for it (that I
hadn't found.)
Anyway, I am working on a project for interfacing a simulation
software, creating input files, processing output, scripting varia
> is there a way to make a perl program find out whether a
> valid X-Server is running?
> I.e. $ENV{DISPLAY} is not a dummy address, if set.
Not in a useful way.
I have a headless (no monitor) Linux server, and a Windows
desktop with a X win server. If I forget to run the X server it
doesn't mea
21 matches
Mail list logo