Thanks John, and Rob.
This reply is quite close to what I am going to do,
but some critical point is wanted here I'll try to explain
my question further
That's about the whole story, but I'll make it short.
For example, I have a list like this :
123ABCDEF456
123456
Hi all,
That's about the whole story, but I'll make it short.
For example, I have a list like this :
123ABCDEF456
123456
654WXYZ321
987654321
ABCDEF123456
WXYZ321
By user's INTEGER input , I will have to find how many similar
patterns are matched within the list according to certain chars
open my $fh, , items/list.db;
print while ($fh);
close $fh;
This is suppose to printout the content in items/list.db ,
but why I get somthing like GLOB(0x162aca7) ??
Thanks in advise.
my $fh;
open $fh, '', 'items/list.db' or die File error: $!;
It just the same as open my $fh =)
print while $fh;
Hmm. I guess this is not a 'read' argument
Thanks in advise anyway =)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
PROTECTED]
To: Li Ngok Lam [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, August 18, 2003 7:38 PM
Subject: Re: I don't understand why this happen
- Original Message -
From: Li Ngok Lam [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 18, 2003 1:10 AM
Subject: I don't
$string=1
blabla;
When Im printing $string I get a new line between 1 and blabla, now I
needt o
split that.. in
my($number, $real_string) = split...
my($number, $real_string) = split /\n/, $string;
HTH
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
Is there any reason why this doesn't print the @missing?
Ive also tried unless ($myhash{$elem} == 1) { push(@missing, $frame) }
Any insight into what I'm doing wrong would be greatly appreciated.
@missing = ;
Wrong assignment, should be:
my @missing = ();
my %myhash = ();
@framelist= (1,
Is there any module in Perl can dealing with Procession ID on Win32?
And does Perll able to stop or start a services / application?
Any pointers where I can start from ?
Thank you very much...
You method does work !
However, you can write as :
$line[1] /= 1000;
# which is the same as $line[1] = $line[1] / 1000;
HTH
- Original Message -
From: Sommer, Henrik [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 11:05 PM
Subject: Simple question
Hi,
How do
You are possibly missing this line :
print Content-type: text/html\n\n;
HTH
- Original Message -
From: mario kulka [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 2:32 AM
Subject: print HTML code; in NETSCAPE
I'm using the following to print HTML to the
$x = sub { $y = shift; print $y };
$X = $x;
$X - (123); # prints 123;
undef $X;
$Z = $x;
$Z - (234); # prints 234
Question :
1. When will you use this kind of style in your code ?
2. Any name for this kind of coding style ?
TIA
- Original Message -
From: K. Parker [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, August 02, 2003 12:00 PM
Subject: Uploading files
On a site I'm developing, I'm trying to create a script that uploads
encrypted files and saves them in a particular directory.
You will do
- Original Message -
From: awarsd [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, August 02, 2003 10:01 PM
Subject: use lib problem
Hi,
I have a problem maybe it is normal.
My problem is with using lib
now to retrieve my module i do this
use lib /path/to/Module;
it works
I'm still puzzled as to how Kenneth managed to get a listing of his
program out of a Perl command. Let us know how you're getting
on Kenneth, if you're still watching this thread.
Hi Rob and Kenneth,
I still watching in this thread, but I am not sure did I missed something in
this thread.
or not.
- Original Message -
From: drieux [EMAIL PROTECTED]
To: cgi cgi-list [EMAIL PROTECTED]
Sent: Wednesday, July 30, 2003 10:37 AM
Subject: Re: How does CGI.pm handles Content-type: text/html\n\n ?
On Tuesday, Jul 29, 2003, at 18:36 US/Pacific, LI NGOK LAM wrote:
[..]
So.. if I create my own
First, your Perl is not a complete version of Perl. You just have the
compiler of Perl.
You almostly missed some very important modules such as strict, warnings,
CGI..etc.
And second, your Perl is out of dated. for Win32 OS, Perl is up to 5.8.0
now.
So go to
: Daniela Silva - Absoluta.net [EMAIL PROTECTED]
To: LI NGOK LAM [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 1:12 AM
Subject: Re: How to read multiple files in the same time ?
Hi,
I want to do something similar, read multiple files and
extract some piece of readed lines
- Original Message -
From: Rob Dixon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 5:44 AM
Subject: Re: I'm a Nebie to PERL
[snap]
It ran and just listed the contents of the helloworld.pl file. PERL
ran but
the .pl program didn't.
Any idea how to
I have read throught the CGI::Carp::fatalsToBrowser...
not quite understand all, but I wonder how does this script
handles the Content-type: text/html\n\n..
So in the some case s(such as warnings) this header line won't re-print ?
TIA
While I hit the submit the Submit button on a form ( in a normal way ),
my cgi script is of cause going to read the data.
My question is that does the data I read are all in the same context format ?
Actually my target point is about the CRLF stuff...
Is that what I read are the same even I am
, and PrintContentT, it check if exists of contentype. If exists,
won't priint the header again, else, print the header.
Is that Okay logically ?
TIA
- Original Message -
From: Wiggins d'Anconia [EMAIL PROTECTED]
To: LI NGOK LAM [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent
Sorry I don't understand your question well, but from overall,
I guess that's all about what you want...
###
# Main.pl
use MyGoodies;
my $fedback = $MyGoodies::Error();
###
# MyGoodies.pm
package MyGoodies;
use strict;
sub Error
{check
How can I do this ? Or could it be done ?
Open some files ( unknown number of files ), depends on users demand.
Then start looking for some desired line ( use regex ).
I have an array to carry the info of matched data ( from which file, which line ).
while the $#array is 99 and all files would
I hope to design an interface of a function like this (not in OO way) :
sub tell_error
{ print Error for @_ }
sub Check_err
{ my %argv = @_;
}
Check_err ( TYPE = [1, 1, \tell_error('Type')], DATA = [ 1, 2, \tell_error
('Data')] );
In Check_err, I want tell_error ('Type')
I have a number $page = 500;
now i want to check that if $page matches a word character then make $page
=1;
$page = 1 unless ( $page =~ /\d/ );
or
$page = 1 if ($page =~ /\D/ );
so originally i did this
my $page =500;
if(($page =~ /\w/) || ($page = 0)){
$page=1;
}
print$page;
\w
if ( -d $path ) { print Directory }
elsif ( -f $path ) { print File }
else { print Not exist }
HTH
- Original Message -
From: Rus Foster [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 8:39 PM
Subject: Checking for a directory
Hi All,
Just trying to work out
Yep ! =)
Even though I can't imagine what a path is not file or directory would imply
more then not exist. But I agree to check the existence for a path by -e
is the safest operation.
- Original Message -
From: [EMAIL PROTECTED]
To: LI NGOK LAM [EMAIL PROTECTED]; Rus Foster [EMAIL
Thanks for this great lesson, I will take account for this on my furture =))
- Original Message -
From: [EMAIL PROTECTED]
To: LI NGOK LAM [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, July 25, 2003 12:17 AM
Subject: Re: Checking for a directory
First, I would ask, how many lines in each file ? under 100 ? above 1 ?
because that effect to choose the tatic for making things done.
Well, I assume there is reasonable to carry 1 names and each name not
longer then 20 character ( consumed about 200KB, still acceptable )
and I
- Original Message -
From: [EMAIL PROTECTED]
To: James Kelty [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 1:21 AM
Subject: RE: Reg Exp Help...
On 22 Jul 2003 09:15:29 -0700, James Kelty [EMAIL PROTECTED] wrote:
- Original Message -
From: Josh Corbalis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 2:24 AM
Subject: print command help
I'm writing a webmin module and I'm trying to add a search function in
right
now but after I search for it and try to display the output
I am going to write a sub accept different types of data type.
My interface is some what like this :
$ret = mySub ( \%hash );
$ret = mySub ( [EMAIL PROTECTED] );
$ret = mySub ( \$calar );
$ret = mySub ( \Sub );
$ret = mySub ( $calar );
$ret = mySub ( %hash );
$ret = mySub ( @rray );
Is there
my (%LIST, @other_list);
@other_list = ( Unknown Length Data Elems );
foreach my $col (@lists)
{
for (@other_list)
{
if ( exist $LIST{$col}[0] ) { Do_smth_2 } # But ERROR either
What should I write here ? So can push vars to $LIST{$col}
}
}
Thanks in
Is there anyway to modify my BIOS clock by Perl ?
and more, is there anyway to adjust my BIOS clock, so
to sync. with other time servers ?
TIA
I've tried to use exec, system, and ``. And also with and without $| = 1;
but seems unable to do what I want.
What I want to do is suppose like this :
print Start;
exec notepad;
print End;
but I found my results are :
If I can see End, the notepad won't come,
If I can run the notepad, I can't
I would say the other name of socket programming is network programming.
The socket modules will act as a interface to deal with other machines, such
as
FTP, telnet, smtp, pop, etc.
I would recommand Network Programming with Perl, by Addison Weskey,
but that's a book, not a site =)
-
snipped some annoying code
foreach my $result(@filelist) # a script snipped was given a file list
{ chomp ($result);
my $com_result = $result;
$com_result =~ s/^$root//;
# $root was a defined var, where using to target the below filter focus
# on the rest of
Is there any methods or documents I can refer to learn how to write a file
at any desire position with any length without to write the whole again ?
I mean, I dont want to write to a new file, kill the old file, rename the new file,
or read the old file, modify it and rewrite the old file etc...
You want seek(), and possibly tell().
perldoc -f seek
Thanks for reply, but seems I have to clarify my question.
'seek' and 'tell' only helping me to target my position within
a file handle.
Say, if I have a 1MB file, and I just want to over write
bytes from 0 to 1000 byte then my job
You will probably want to open the file with a mode of +.
Yes and thank you! That does what I want now. Thank you very much !!
But I found new problem now. I did what I want if I try on a bitmap file,
but for text file, my new contents will overwrite the whole file, what's
that about
or
#/!perl -w
use strict;
use IO::File;
my $offset = 3;
my $file_binary = fg;
sysopen(OUTFILE, out.txt, O_WRONLY) or print Couldn't open file for
read/write ($!)\n;
binmode OUTFILE;
sysseek OUTFILE, $offset, 0;
syswrite OUTFILE, $file_binary, length($file_binary);
close OUTFILE;
I'm trying to put the string from the system(ls -al) into a variable.
@list = `ls -al`;
It simply prints to the page and puts 1 in the variable.
What's that mean '1' anyway ?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
perldoc -f srand
- Original Message -
From: meriwether lewis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, April 05, 2003 10:09 AM
Subject: random sub returns same results...
Hi Gurus!
I have the following sub which creates a random
string. Each time I call the sub in
the table size...
Vincent
-Original Message-
From: Li Ngok Lam [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2003 5:14 PM
To: [EMAIL PROTECTED]
Subject: How to measure Array or Hash's byte size ?
My method sounds stupid, but still works :
my @array = ('123', 'abc', 'def', 1
My method sounds stupid, but still works :
my @array = ('123', 'abc', 'def', 1..9);
my $len_of_array = 0 ;
foreach my $elem(@array)
{$len_of_array += length($elem) }
print $len_of_array ; # I got '18'
my %hash = (1=2, 2=3, 3=4);
foreach my $key(keys(%hash))
{$len_of_hash +=
I don't know if it is better or faster, but it is shorter. :-)
$ perl -le'
my @array = ( 123, abc, def, 1 .. 9 );
my $len_of_array = do { local $; length @array };
print $len_of_array;
'
18
$ perl -le'
my %hash = ( 1 = 2, 2 = 3, 3 = 4 );
my $len_of_hash = do { local $; length
What about the user says :
body
text=#123456
bgcolor=#aabbcc
or
body bgcolor='#123456'
or
body bgcolor=
red
Anyway, the bgcolor can be formed or change again via javascript or CSS.
I mean, blocking bgcolor in body tag cannot solve your potential problem.
But you may find someway to put this in
Hi all, I am totally new about CGI and Perl, and now, I've facing my first problem so
hope somebody
can help...
I have this html code :
form action=getfile.pl method=post enctype=multipart/form-data
input type=file name=file
input type=submit
/form
and I have this Perl code :
51 matches
Mail list logo