Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Store data into array by looping?

by FreeBeerReekingMonk (Deacon)
on Apr 10, 2019 at 22:08 UTC ( #1232426=note: print w/replies, xml ) Need Help??


in reply to Store data into array by looping?

Replying on the UPDATE (you really should create a new question, as older questions get ignored in favour of new questions).

Just capture nand2_1 into a variable, like you already did, and then just break it into bits, like so:

my $gate_name = 'nand2_1'; my ($gtype, $gfirst, $gsecond) = ($gate_name =~ /^(\w+)(\d+)_(\d+)/); print "# $gtype # $gfirst # $gsecond #\n";

output:

# nand # 2 # 1 #

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1232426]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2020-07-12 10:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?