Leser: 1
10 Einträge, 1 Seite |
methode( ([@ARRAY], {%HASH}) );
1
2
3
4
5
6
my @tmp = @_;
shift;
@tmp = shift;
my @ARRAY = @{$tmp[0]};
@tmp = shift;
my %HASH = %{$tmp[0]};
QuoteIn general your Excel file will be closed automatically when your program ends or when the Workbook object goes out of scope, however the close() method can be used to explicitly close an Excel file.
1
2
3
4
5
6
7
8
9
10
11
12
my @ARRAY = qw( 1 2 3 );
my %HASH = ( 1 = 'TEST', 2 => 'OK');
methode (\@ARRAY, \@HASH);
sub methode {
my $arr_ref = shift;
my $hsh_ref= shift;
print '$arr_ref->[1] ist ', $arr_ref->[1];
print '$hsh_ref->{2} ist ', $hsh_ref->{2};
}
1
2
3
4
5
6
7
8
9
10
11
12
sub createRecord {
return {
'ID' => 'Record',
'FileName' => shift,
'LineNumber'=> shift,
'LineData' => shift,
'Treatment' => shift,
};
}
# $eins - $vier sind alles normale skalare
check(createRecord($File::Find::name, $eins, $zwei, $drei, $vier));
1
2
3
4
5
6
7
8
9
10
11
12
13
sub check {
my $record = shift; # <--- Probleme
#my $record = { # <--- so würde alles funktionieren
# 'FileName' => 'c:\blah\fasel2.txt',
# 'ID' => 'Record',
# 'LineData' => 'some text comes here',
# 'LineNumber' => '222',
# 'Treatment' => undef,
#};
# ... etwas Logik dazwischen bis ...
createObject($record, $eins, $zwei, $drei, $vier); # <-- hier gebe ich den bereits erhaltenen Record weiter!
}
10 Einträge, 1 Seite |