Sumo Wrestler (or just ate too much) wrote:
>
> Try something like this:
>
> use strict;
> use Data::Dumper;
>
> $var = '
> iptables -A INPUT -p tcp -s 123.45.678.90 --dport 22 -j ACCEPT
>
> and ...
>
> iptables -A INPUT -p tcp --dport 25 -j ACCEPT
> ';
>
> open (FH, '<', \$var)
> or die
Richard Bagshaw wrote:
Peeps,
Hi Richard.
I'm very new to perl and I have been trying to solve a problem for a few
days now, I am reading a file that I use to setup my firewall rules on a
Linux box, the file contains many lines, but as an example I will show
just two here :-
iptables -A
D. Bolliger am Sonntag, 14. Mai 2006 00.34:
> Richard Bagshaw am Samstag, 13. Mai 2006 23.11:
> > Hi,
> >
> > Thanks for the points, you are totally right though, I had thought about
> > the order being different in the lines, im still pretty green when it
> > comes to regular expressions, not yet
John W. Krahn am Sonntag, 14. Mai 2006 01.03:
> D. Bolliger wrote:
> > John W. Krahn am Sonntag, 14. Mai 2006 00.11:
> >>Or you could "cheat" and let Getopt::Long parse it for you:
> >>
> >>$ perl -MGetopt::Long -MData::Dumper -e'
> >>$_ = q[iptables -A INPUT -p tcp -s 123.45.678.90 --dport 22 -j A
D. Bolliger wrote:
> John W. Krahn am Sonntag, 14. Mai 2006 00.11:
>>
>>Or you could "cheat" and let Getopt::Long parse it for you:
>>
>>$ perl -MGetopt::Long -MData::Dumper -e'
>>$_ = q[iptables -A INPUT -p tcp -s 123.45.678.90 --dport 22 -j ACCEPT];
>>my %h;
>>{ local @ARGV = split;
>>GetOp
John W. Krahn am Sonntag, 14. Mai 2006 00.11:
> Richard Bagshaw wrote:
> > I'm very new to perl and I have been trying to solve a problem for a few
> > days now, I am reading a file that I use to setup my firewall rules on a
> > Linux box, the file contains many lines, but as an example I will show
Richard Bagshaw am Samstag, 13. Mai 2006 23.11:
> Hi,
>
> Thanks for the points, you are totally right though, I had thought about
> the order being different in the lines, im still pretty green when it
> comes to regular expressions, not yet figured out a way to get around
> the differences in ord
Richard Bagshaw wrote:
>
> I'm very new to perl and I have been trying to solve a problem for a few
> days now, I am reading a file that I use to setup my firewall rules on a
> Linux box, the file contains many lines, but as an example I will show
> just two here :-
>
> iptables -A INPUT -p tcp -
Hi,
Thanks for the points, you are totally right though, I had thought about
the order being different in the lines, im still pretty green when it
comes to regular expressions, not yet figured out a way to get around
the differences in order, but I will RTFM :-)
Thanks for the feedback :-)
Richard Bagshaw am Samstag, 13. Mai 2006 15.56:
> Peeps,
>
> I'm very new to perl and I have been trying to solve a problem for a few
> days now, I am reading a file that I use to setup my firewall rules on a
> Linux box, the file contains many lines, but as an example I will show
> just two here :
On 5/13/06, Richard Bagshaw <[EMAIL PROTECTED]> wrote:
I'm very new to perl and I have been trying to solve a problem for a few
days now, I am reading a file that I use to setup my firewall rules on a
Linux box, the file contains many lines, but as an example I will show
just two here :-
iptable
Peeps,
I'm very new to perl and I have been trying to solve a problem for a few
days now, I am reading a file that I use to setup my firewall rules on a
Linux box, the file contains many lines, but as an example I will show
just two here :-
iptables -A INPUT -p tcp -s 123.45.678.90 --dport 2
12 matches
Mail list logo