...'Sefer Yetzirah' was brought up, as well as the 'Sefer Raziel', and I know they're mystical texts, but, they were/are used for magical purposes as well, and I was just wondering, what is the Jewish perspective on magic?
Actually, as it happens, magic in the Jewish traditions and communities is one of my primary areas of professional expertise: I wrote a number of my major papers in rabbinical school on the topic, and have taught a couple of classes on it, and plan to do some serious writing on it.
As for what to read first, I gave my go-to list
here, but Gershon Winkler's book is not too bad. I find him a bit New-Age/Renewal/crunchy for my tastes, but of course that's a fairly standard risk, when venturing into the topic of magic and "applied" mysticism. To read actual mysticism, Kaplan's translations of/commentaries on
Sefer Yetzirah and
Bahir are first rate, must-haves. Daniel Matt's ongoing translation of the Zohar is also a must-have, and is phenomenal-- although it is still well-nigh impenetrable for true mystical or magical understanding, unless one is already quite expert in Kabbalah and Jewish lore, and/or has the teaching of such a one.
Basically, to answer your initial question, though, there are (naturally) a number of attitudes that Judaism takes and has taken historically. Despite what might appear to be some fairly ironclad prohibitions in the Torah, many ways to read those things differently (either by reinterpretation, or by contextualizing, or by extremely literal readings of the text) have been employed so as to make room for magic in Judaism.
The Torah itself, if one looks at the text layers with a critical eye, is by no means coherent on its prohibitions in that regard. E and J have little problem with magic. P has problems with it at least partially in terms of desiring to keep it a monopoly of the priesthood, but is generally intolerant of it in any regard. And D seems quite anti-magic also. And reading the rest of the Tanakh with the same eye of historical criticism, we can readily postulate that there were people who were workers of magic (of one sort or another) throughout the Biblical period, who enjoyed, if inconsistent acceptance from those in power, fairly constant acceptance from the populace at large.
Talmud also yields similar streams of thought. There seem to have been those Rabbinic sources who were virulently anti-magic, and some who were relatively neutral about the topic, but also strong Rabbinic sources who favored magic, and supported its use, at least for certain things, or tacitly.
We have no magical texts from prior to the Rabbinic period, but it is believed, judging from Biblical texts and apocrypha of various kinds, that pre-Rabbinic magic was oriented heavily toward healing, and perhaps divination, but also certainly toward fertility (mostly agricultural, but possibly human as well). Magic was also predominately theurgic, and not thaumaturgical, which is in part why ancient Israel was so prone to henotheistic syncretization of idolatrous practices: Canaanites, Moabites, and Edomites all had very popular and vigorous fertility rites, with considerable sympathetic sex magic to propagate crops and rain and whatnot. And let's face it, if having more gods for more theurgic possibilities was attractive to the ancient Israelites...well, it's hard not to embrace idolatrous practices when they come with the free option for ritual orgies.
That said, magic in the Rabbinic period seems to have fallen into two divisions: magic practiced by Rabbinic Jews, and magic practiced by non-Rabbinic Jews. That practiced by non-Rabbinic Jews-- mostly Hellenics-- was heavily syncretic, and involved complex rituals (Biblical magic seems to have been light on rituals, although magical objects were apparently popular), and magics for healing, divination, and agricultural success were joined by spells for gain of wealth or power or love or strength. A perfect example of this division of magic is
Sefer ha-Razim (The Book of Secrets), which comes to us from the Jewish community of Alexandria, and seems to have been compiled over the years 200-400 CE, and though written in Hebrew characters, and often drawing heavily on Jewish-- even Rabbinic-- ideas and concepts, nontheless draws also on Greek mythology, Egyptian magic, and even early gnostic concepts in places (the texts are deeply diverse). A large percentage of the texts are, for one reason or another, entirely incompatible with mainstream Rabbinic Judaism.
Rabbinic magic also kept going with divination, healing, and agricultural prosperity. But to those were added spells for warding against, banishing, and sometimes commanding, demons of various kinds. The Talmud discusses several kinds of demons, and even on occasion offers suggestions on magic to deal with them. Rabbinic Midrash also is rife with legends of demons. In any case, the populace apparently were quite concerned about them, as there appears to have been fairly regular work for exorcists and amulet makers. Wonder-working of various kinds was often a way by which Rabbis demonstrated their mystical power, but non-Rabbi wonder-workers also seem to have been well-known. Some were not tolerated (like Jesus), but others were, like Choni ha-Me'agel (Choni the Circle-Maker), who was perhaps most famous for bringing rain in quite unorthodox ways.
It was at that time that magic within Rabbinic Judaism itself began to divide up into two schools of thought. On the one hand, workers of magic-- theurgic or thaumaturgical (though most were theurgic), this was the study and the use of purely practical magic. On the other, the Yoredei Merkavah, the earliest precursors of the Kabbalists, who apparently were indeed capable of various kinds of magic, but did not study to learn practical magic. Rather, they studied to understand mystical secrets of the universe, in order to raise their souls and draw closer to God; supernatural powers were merely a side-effect of such study.
To some degree, this latter division has remained constant ever since. There are the great Kabbalistic texts (e.g.,
Sefer Yetzirah, Sefer ha-Bahir, Zohar), and there are the grimoires (e.g.
Sefer Raziel Hamalakh, Sifra Harba d'Moshe, Get ha-Shemot)-- mostly works of what we might call "Low Kabbalah," that is, practical magic that is not incompatible with Rabbinic Judaism. The former are well and widely studied unto this day. The latter were greatly popular in the Medieval and Renaissance eras, but in the past two or three hundred years have become far less studied, and today few are familiar with them.
By the end of the seventeenth century, the making of grimoires had really more or less ended in the Ashkenazi world, although in the Mizrahi/Sefardi world, people to this day continue to assemble collections on the making of amulets, talismans, and minor charms to ward off evil, or occasionally to promote health or prosperity.
In no small part, the sharp decline in widespread acceptance of practical magic among Ashkenazi Jews around the seventeenth and eighteenth centuries has to do with the unfortunate and catastrophic incidents of
Shabtai Tzvi and
Yakov Frank, the false messiahs of the 17th and 18th centuries respectively. Tzvi especially was a well-known wonder-worker, and professed to know and teach magical arts. The devastating deception of these false messiahs had crushing impact on mysticism and the acceptance of mystical and magical learning in mainstream Judaism, and might have eventually crippled them altogether, had it not been for the appearance of Hasidism, whose founder, the Baal Shem Tov ("Good Master of a Name."
Baal Shem, "master of a [Divine] Name" was a common appellation of folk magicians and charismatic mystics. "Baal Shem Tov" marks him out as being particularly noted for benevolence or saintliness. His real name was R. Yisrael ben Eliezer) seems to have become active around 1740 or so. The Baal Shem's disciples began writing the founding works of Hasidic thought, and they were all deeply influenced by Kabbalah. Although the Hasidic masters themselves often worked wonders, they wrote no instructions on magic, though their writings contain many subtle mystical teachings.
Today interest in magic among Jews is only beginning to resurface in the main stream. Most Ashkenazi Orthodox sources strongly urge avoiding magic of any kind, and to rather use prayer instead, as a kind of liturgical theurgy. Some Mizrahi and Sefardi authorities have become less tolerant of certain kinds of folk magic, due to Ashkenazi influence. But among many Mizrahi and Sefardi communities, especially amongst the Yemenite Jews, many kinds of magic are still accepted, and others still widely tolerated. In the US, and to a lesser extent, in Britain, some among the Jewish Renewal movement have begun reintegrating magic into Jewish practice, including some who syncretize from other magical traditions. There are also those who attempt to syncretize ritual or theology or cosmogony from traditions incompatible with Judaism, resulting in some combinations which are interesting, but entirely inappropriate to traditional Judaism.
Today, the average non-Orthodox Jew in America or Britain likely does not believe in magic at all. The Orthodox will usually believe in it, but only to the extent that a relatively literal reading of Tanakh and Talmud demand it, and they will consider it, at best, a dubiously gray area.