Using a $ retrieves the identified element, which is a scalar. @ takes an array slice from $index to the end. While both these will get your value, the difference can be important, for example:
$arr[0] = ; # reads the first line, as intended.
@arr[0] = ; # reads the whole file, "disappearing" everything after the first line.
The second is a single item array slice and is deprecated.
$arr[0] = ; # reads the first line, as intended.
@arr[0] = ; # reads the whole file, "disappearing" everything after the first line.
The second is a single item array slice and is deprecated.
No comments :
Post a Comment