blake in
<[EMAIL PROTECTED]>:
> I am new to perl and attempting to write a script that will do a reverse dns
> lookup on an ip [snip]
Just looking that far, I don't think your script will work as you
intend. Here's a ptr lookup using dig ...
| dig -x 217.151.101.100
| 100.101.151.217.in-addr.ar
On Mon Dec 01 2008 @ 7:13, blake askew wrote:
> Thanks for the help John. I have made the changes you suggested and managed
> to get everything working properly. One more question though that is
> completely different, how do I allow users to specify switches on the
> command line in any order to
Thanks for the help John. I have made the changes you suggested and managed
to get everything working properly. One more question though that is
completely different, how do I allow users to specify switches on the
command line in any order to be used in my program. For example, I want the
syntax t
blake askew wrote:
I am new to perl and attempting to write a script that will do a reverse dns
lookup on an ip, store this result into a file, then read the file in order
to do a whois lookup. The whois lookup answer should also be written to a
seperate file. I have the reverse dns lookup workin
I am new to perl and attempting to write a script that will do a reverse dns
lookup on an ip, store this result into a file, then read the file in order
to do a whois lookup. The whois lookup answer should also be written to a
seperate file. I have the reverse dns lookup working, but when I also ca
Vahid wrote:
> Hi all,
> I have the following code to sort UNIX's password file, it works fine
> but can only display on stdout. How can I make it write the output to
> a file?
> Thanks,
>
> #!/bin/perl -w
> #
> use strict;
> open(myFILE, '|-','awk','-F:','s[$1]++==0' ) or die $!;
> open(passwdFH,
Hi all,
I have the following code to sort UNIX's password file, it works fine
but can only display on stdout. How can I make it write the output to
a file?
Thanks,
#!/bin/perl -w
#
use strict;
open(myFILE, '|-','awk','-F:','s[$1]++==0' ) or die $!;
open(passwdFH, "passwd");
while () { print myFILE
incognito wrote:
>Thank you for your attention, Bob.
>
>>What is your actual regex? At a minimum, you'll need /g modifier.
>>You may need /m and/or /s as well.
>
>May be I didn't explained my prob exactly. I don't have a problem
>with the regex (and yes, I have the /m /g and /s). Related to the
>
Wc -Sx- Jones wrote:
[snip]
>
> my $file = "20040301-www.tgz";
>
[snip]
>
> But I have a question -
>
> Does even mentioning (?:) usage break capturing?
>
> I get undefined errors when trying:
>
> $file =~ /^(\d+)-www.t(?:ar.)gz/i;
> print $1;
no. it won't break capturing. you get undef
Owen wrote:
On Mon, 1 Mar 2004 18:08:08 +0100
incognito <[EMAIL PROTECTED]> wrote:
open(FH, "> $pkg_filename") or die "could not create $pkg_filename";
while ($input =~ m/.../) {
print $1;
FH->print("$1\n") or die "could not write to $pkg_filename";
}
I would have thought that to g
Thank you Bob and Owen.
[Bob]
> I notice you don't put an explicit path on the filename. Is it possible the
> current directory is something other that what you expect it to be, and the
> file is being successfully created in another location?
I thought about that and so I tried an absolute path
On Mon, 1 Mar 2004 18:08:08 +0100
incognito <[EMAIL PROTECTED]> wrote:
> open(FH, "> $pkg_filename") or die "could not create $pkg_filename";
> while ($input =~ m/.../) {
> print $1;
> FH->print("$1\n") or die "could not write to $pkg_filename";
> }
I would have thought that to ge
incognito wrote:
> Thank you for your attention, Bob.
>
> > What is your actual regex? At a minimum, you'll need /g modifier.
> > You may need /m and/or /s as well.
>
> May be I didn't explained my prob exactly.
> I don't have a problem with the regex (and yes, I have the /m /g and
> /s). Related
Thank you for your attention, Bob.
> What is your actual regex? At a minimum, you'll need /g modifier. You may
> need /m and/or /s as well.
May be I didn't explained my prob exactly.
I don't have a problem with the regex (and yes, I have the /m /g and /s).
Related to the regex, my script works fi
Reinhard Mantey wrote:
> undef $/;
> my $input = <>;
> my $pkg_filename = "longnames.txt";
>
> open(FH, "> $pkg_filename") or die "could not create $pkg_filename";
> while ($input =~ m/.../) {
What is your actual regex? At a minimum, you'll need /g modifier. You may
need /m and/or /s as well.
Hello,
I came to perl by J.Friedl's regex-book without any perl-experiences.
I wrote a little script to scan packages and their dependencies from a book
(lfs). The script works fine and I get the packages with their dependencies.
Now I tried to expand that script that way, that I wanted to write
Hello,
I came to perl by J.Friedl's regex-book without any perl-experiences.
I wrote a little script to scan packages and their dependencies from a book
(lfs). The script works fine and I get the packages with their dependencies.
Now I tried to expand that script that way, that I wanted to write
Support wrote:
> Hi all
> I have a little bit of code you may be able to help with.
> I load a file into an array with
>
> foreach $lines(@database_array) {
>@edit_array = split(/\:/,$lines);
>push(@member_array,[EMAIL PROTECTED]);
>$x++;
> } #loop
>
> and then play around with the a
Support wrote:
>
> Hi all
Hello,
> I have a little bit of code you may be able to help with. I load a
> file into an array with
>
> foreach $lines(@database_array) {
You should limit the scope of $lines to the foreach loop. Does $lines
contain multiple lines or just one line? Perhaps you sho
On Feb 2, Support said:
>foreach $lines(@database_array) {
> @edit_array = split(/\:/,$lines);
> push(@member_array,[EMAIL PROTECTED]);
> $x++;
>} #loop
First, it doesn't look like you're using 'strict', which means you're not
declaring your variables. This is probably going to lead to trou
So you need to
dereference them. I think this is what you are after.
join("\:",@{$member_array[$count]});
Rob
-Original Message-
From: Support [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 01, 2004 2:31 PM
To: [EMAIL PROTECTED]
Subject: Writing to file
Hi all
I have a little bit
Hi all
I have a little bit of code you may be able to help with. I load a file
into an array with
foreach $lines(@database_array)
{
@edit_array
=
split(/\:/,$lines);
push(@member_array,[EMAIL PROTECTED]);
$x++;
}
#loop
and then pl
I stand corrected.. It should be ">" not ">>"..
Should stop reading the list late at night..
Thanks
On Tue, 22 Jul 2003 [EMAIL PROTECTED] wrote:
>
> On Mon, 21 Jul 2003 21:55:03 -0600 (MDT), [EMAIL PROTECTED] wrote:
>
> > open the file with ">>
On Mon, 21 Jul 2003 21:55:03 -0600 (MDT), [EMAIL PROTECTED] wrote:
> open the file with ">>"
> This will cause an overwrite..
>
Actually that is an "append". Maybe there is a definition issue, aka I would think of
an "overwrite" to be a ">" where
open the file with ">>"
This will cause an overwrite..
On Mon, 21 Jul 2003, awarsd wrote:
> Hi,
>
> I'm curious to know if it is possible to write to file with overwritting
> information without putting into an array
> if i have in a file
> a
> b
> c
> d
> e
> and i want to add g-r-t-u-x i wou
awarsd <[EMAIL PROTECTED]> wrote:
:
: I'm curious to know if it is possible to write
: to file with overwritting information without
: putting into an array if i have in a file
:
: a
: b
: c
: d
: e
: and i want to add g-r-t-u-x i would get
: now in the file
:
: g
: r
: t
: u
: x
: e <-- stays the
Hi,
I'm curious to know if it is possible to write to file with overwritting
information without putting into an array
if i have in a file
a
b
c
d
e
and i want to add g-r-t-u-x i would get
now in the file
g
r
t
u
x
e <-- stays the same no overwrite.
any help is appreciated
Anthony
--
To unsu
Richard Noel Fell wrote:
>
> Here is a subroutine that prints strings to a file. I want the routine
> to write strings to the file in the format
> Question1:factor(x^2+4*x+3)=(x+3)*(x+1).
> However, what is written to file is
> Question1:factor(x^2+4*x+3)
> =(x+3)*(x+1), that is,
> a newline befo
Try removing the newline at the end of your question with a call to chomp.
else{
for (my $i=1; $i<=$#qk+1;$i++){
chomp ($Question_hash{$qk[$i-1]});
print In1
"Question"."$i".":factor$Question_hash{$qk[$i-1]}=$Answer_hash{$ak[$i-1]}\n";
}
>Here is a subroutine that prints strings to a file.
]]
Sent: Thursday, March 28, 2002 11:26
To: [EMAIL PROTECTED]
Subject: Question about writing to file
Here is a subroutine that prints strings to a file. I want the routine
to write strings to the file in the format
Question1:factor(x^2+4*x+3)=(x+3)*(x+1).
However, what is written to file is
Question1
Here is a subroutine that prints strings to a file. I want the routine
to write strings to the file in the format
Question1:factor(x^2+4*x+3)=(x+3)*(x+1).
However, what is written to file is
Question1:factor(x^2+4*x+3)
=(x+3)*(x+1), that is,
a newline before the = sign. Is there some way of inhib
On Thu, Aug 09, 2001 at 06:53:15PM -0500, CDitty wrote:
> The email.txt file is an empty file and has the correct permissions.
You're reading from a file, expecting data to be there, but the file
is empty. Could this be your problem?
> # This section needs to cycle through the emails.txt file
Can someone take a look at this and see what is wrong? I am still
learning perl and this is giving me a tough time.
The email.txt file is an empty file and has the correct permissions.
Thanks
Chris
# This section needs to cycle through the emails.txt file.
# Once it has cycled through the f
33 matches
Mail list logo