LaylaNahar
Programmer
Hello,
I want to build an array in perl by copying and pasting, as input, a list like the one below.
; MAC=0004f2125ad2
; MAC=0004f2125e5c
; MAC=0004f2125f15
; MAC=0004f212604a
The closest I have come is by using this code:
while(<STDIN>)
{
$newmac = <STDIN>;
push(@maclist, $newmac);
}
but it's buggy. I lose at least the first line pasted from the buffer. Sometimes I lose random lines from within the list if the copied buffer is long enough.
Can I paste a copied list that includes carriage returns and have a perl script parse what I paste without losing lines or data?
thank you
Layla
ps: My goal is to have to run one script and hit 'insert' only once - I'm open to any kind of solution that will allow that end.
I want to build an array in perl by copying and pasting, as input, a list like the one below.
; MAC=0004f2125ad2
; MAC=0004f2125e5c
; MAC=0004f2125f15
; MAC=0004f212604a
The closest I have come is by using this code:
while(<STDIN>)
{
$newmac = <STDIN>;
push(@maclist, $newmac);
}
but it's buggy. I lose at least the first line pasted from the buffer. Sometimes I lose random lines from within the list if the copied buffer is long enough.
Can I paste a copied list that includes carriage returns and have a perl script parse what I paste without losing lines or data?
thank you
Layla
ps: My goal is to have to run one script and hit 'insert' only once - I'm open to any kind of solution that will allow that end.