in reply to Loading data into an array from a file problem
P.S. Next time use a descriptive title. We know you need help if you're here.#!/usr/bin/perl -w use strict; my $string = '1,2,3'; my @names; ### This prints one line (what you're getting) @names = ($string); print +(join '--' => @names), "\n"; ### This prints multiple lines (what you want) @names = split ',' => $string; print +(join '--' => @names), "\n";
|
|---|