Re: infile data

2005-09-06 Thread John W. Krahn
Tom Allison wrote: >>>I ended up with something like: >>>my $string = join('',()); >>>my ($sql1, $sql2) = split(/\nn\n/sm, $string); >> ^ >>You probably meant /\n\n/. > Yes, thanks >> >>>But I like the $/ idea. >>You could set $/ to paragraph mode: >> >>my ( $sql1,

Re: infile data

2005-09-06 Thread Tom Allison
>> I ended up with something like: >> my $string = join('',()); >> my ($sql1, $sql2) = split(/\nn\n/sm, $string); >^ >You probably meant /\n\n/. Yes, thanks > > >> But I like the $/ idea. > >You could set $/ to paragraph mode: > >my ( $sql1, $sql2 ) = do { local

Re: infile data

2005-09-06 Thread John W. Krahn
Tom Allison wrote: > Matija Papec wrote: >> Tom Allison wrote: >> >>> I've been using the practice of putting something at the bottom of a >>> file for holding static data, like SQL, by calling a __DATA__ handle: >>> >>> my $sql = join('',()); >> >> #more efficient >> my $sql = do { local $/; }; >

Re: infile data

2005-09-06 Thread Tom Allison
Matija Papec wrote: Tom Allison wrote: I've been using the practice of putting something at the bottom of a file for holding static data, like SQL, by calling a __DATA__ handle: my $sql = join('',()); #more efficient my $sql = do { local $/; }; check perldoc perlvar if you want to know mo

Re: infile data

2005-09-06 Thread John W. Krahn
Tom Allison wrote: > I've been using the practice of putting something at the bottom of a > file for holding static data, like SQL, by calling a __DATA__ handle: > > my $sql = join('',()); > > > > __DATA__ > select . > > > Is there any way to do this twice? > To define two sets of static

Re: infile data

2005-09-06 Thread Matija Papec
Tom Allison wrote: I've been using the practice of putting something at the bottom of a file for holding static data, like SQL, by calling a __DATA__ handle: my $sql = join('',()); #more efficient my $sql = do { local $/; }; check perldoc perlvar if you want to know more about $/ __DATA__

infile data

2005-09-06 Thread Tom Allison
I've been using the practice of putting something at the bottom of a file for holding static data, like SQL, by calling a __DATA__ handle: my $sql = join('',()); __DATA__ select . Is there any way to do this twice? To define two sets of static SQL? -- To unsubscribe, e-mail: [EMAIL PROT