royserna03 has asked for the wisdom of the Perl Monks concerning the following question:
Hey guys, I am trying to make a serial number generator with the user's input. My problem with this code is that when I want the array to be on the excel file, it just gives me the last object of the array. However if I use print, it prints all of them. Also I cannot find a way to keep a counter so that after the user is done, the numbers won't repeat. Any help will be very appreciated. Thank You
#!/usr/bin/perl -w use Excel::Writer::XLSX; my $workbook = Excel::Writer::XLSX->new( 'simple.xlsx' ); my $worksheet = $workbook->add_worksheet(); print "How many Sirial Numbers do you need?\n"; $comp= ITS; $mal= <STDIN>; for ($number=0001; $number< $mal; $number++) { $exp= $comp.$number; } @array= $exp; $array_ref = \@array; $worksheet->write_col( 0,0 , $array_ref);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: serial number generator
by Athanasius (Archbishop) on Oct 03, 2012 at 03:03 UTC | |
by GrandFather (Saint) on Oct 03, 2012 at 04:26 UTC | |
by royserna03 (Initiate) on Oct 03, 2012 at 20:31 UTC | |
by Athanasius (Archbishop) on Oct 04, 2012 at 02:59 UTC | |
by royserna03 (Initiate) on Oct 04, 2012 at 23:30 UTC | |
by royserna03 (Initiate) on Oct 04, 2012 at 03:51 UTC | |
by Anonymous Monk on Oct 04, 2012 at 04:21 UTC |