![]() |
![]() |
10 Einträge, 1 Seite |
1
2
3
4
5
6
7
open(HANDLE, $file)
or die $!;
my $bin_data;
$bin_data .= for <HANDLE>;
...INSERT INTO fotos (bin_data, name) VALUES ($bin_data, $name)
1
2
3
my $bin_data = do{ local (@ARGV,$/) = $file; <> };
....INSERT INTO fotos (bin_data, name) VALUES ($bin_data, $name)
1
2
3
my $bin_data = do{ local (@ARGV,$/) = $file; <> };
....INSERT INTO fotos (bin_data, name) VALUES ($bin_data, $name)
local (@ARGV,$/) = $file; <>
local (@ARGV,$/) = $file;
my (@array,$var) = $variable
Quote<FILEHANDLE> may also be spelled readline(*FILEHANDLE). See readline.
The null filehandle <> is special: it can be used to emulate the behavior of sed and awk. Input from <> comes either from standard input, or from each file listed on the command line. Here's how it works: the first time <> is evaluated, the @ARGV array is checked, and if it is empty, $ARGV[0] is set to "-", which when opened gives you standard input. The @ARGV array is then processed as a list of filenames.
INSERT INTO fotos (name, daten) VALUES ('testbild', '$bin_data')
my $bin_data = $dbh->quote($filehandle); # funzt auch nicht
INSERT INTO fotos (name, daten) VALUES ('testbild', '$bin_data')
QuoteINSERT INTO fotos (bin_data, name) VALUES ($bin_data, $name)
INSERT INTO fotos (name, daten) VALUES ('testbild', $bin_data)
my $bin_data = do{ local (@ARGV,$/) = $file; <> };
![]() |
![]() |
10 Einträge, 1 Seite |